mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
exec: reintroduce MemoryRegion caching
MemoryRegionCache was reverted to "normal" address_space_* operations for 2.9, due to lack of support for IOMMUs. Reinstate the optimizations, caching only the IOMMU translation at address_cache_init but not the IOMMU lookup and target AddressSpace translation are not cached; now that MemoryRegionCache supports IOMMUs, it becomes more widely applicable too. The inlined fast path is defined in memory_ldst_cached.inc.h, while the slow path uses memory_ldst.inc.c as before. The smaller fast path causes a little code size reduction in MemoryRegionCache users: hw/virtio/virtio.o text size before: 32373 hw/virtio/virtio.o text size after: 31941 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
a411c84b56
commit
48564041a7
6 changed files with 280 additions and 20 deletions
4
memory.c
4
memory.c
|
@ -298,7 +298,7 @@ static bool flatview_ref(FlatView *view)
|
|||
return atomic_fetch_inc_nonzero(&view->ref) > 0;
|
||||
}
|
||||
|
||||
static void flatview_unref(FlatView *view)
|
||||
void flatview_unref(FlatView *view)
|
||||
{
|
||||
if (atomic_fetch_dec(&view->ref) == 1) {
|
||||
trace_flatview_destroy_rcu(view, view->root);
|
||||
|
@ -822,7 +822,7 @@ static void address_space_add_del_ioeventfds(AddressSpace *as,
|
|||
}
|
||||
}
|
||||
|
||||
static FlatView *address_space_get_flatview(AddressSpace *as)
|
||||
FlatView *address_space_get_flatview(AddressSpace *as)
|
||||
{
|
||||
FlatView *view;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue