Optimize memory handling (#1963)

* optimize ram block handling

Save the last element of the ram_list. This allows to
faster find where to add new elements when they are not
bigger then page size.

* save ram_list freed

this keeps the optimization for find_ram_offset() intact after snapshot
restore.

* cow only clear the tlb of affected pages

* update flatview when possible

Building each flatview new when the memory has changed is quite
expensive when many MemoryRegions are used. This is an issue when using
snapshots.

* update benchmark for new api

* save flatview in context

this avoids rebuilding the flatview when restore a context.

* init context flatview with zero

* address_space_dispatch_clear remove subpage with higher priority

* docutemnt the options for UC_CTL_CONTEXT_MODE

Specialy stress that with UC_CTL_CONTEXT_MEMORY it is not possible to
use the context with a different unicorn object.
This commit is contained in:
PhilippTakacs
2024-10-16 15:51:13 +02:00
committed by GitHub
parent fea3411803
commit e8ca3cbea5
27 changed files with 236 additions and 45 deletions

View File

@@ -54,6 +54,7 @@
#define vm_start vm_start_sparc
#define address_space_dispatch_compact address_space_dispatch_compact_sparc
#define flatview_translate flatview_translate_sparc
#define flatview_copy flatview_copy_sparc
#define address_space_translate_for_iotlb address_space_translate_for_iotlb_sparc
#define qemu_get_cpu qemu_get_cpu_sparc
#define cpu_address_space_init cpu_address_space_init_sparc
@@ -90,6 +91,7 @@
#define iotlb_to_section iotlb_to_section_sparc
#define address_space_dispatch_new address_space_dispatch_new_sparc
#define address_space_dispatch_free address_space_dispatch_free_sparc
#define address_space_dispatch_clear address_space_dispatch_clear_sparc
#define flatview_read_continue flatview_read_continue_sparc
#define address_space_read_full address_space_read_full_sparc
#define address_space_write address_space_write_sparc