summary refs log tree commit diff stats
path: root/include/exec/cpu-all.h
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2018-03-18 18:26:36 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2018-05-09 00:13:38 +0200
commit48564041a73adbbff52834f9edbe3806fceefab7 (patch)
tree6ea31760c88eaa9d3da36effab22e7d8343ebee2 /include/exec/cpu-all.h
parenta411c84b561baa94b28165c52f21c33517ee8f59 (diff)
downloadfocaccia-qemu-48564041a73adbbff52834f9edbe3806fceefab7.tar.gz
focaccia-qemu-48564041a73adbbff52834f9edbe3806fceefab7.zip
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>
Diffstat (limited to 'include/exec/cpu-all.h')
-rw-r--r--include/exec/cpu-all.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h
index 173edd1fb4..a635f532f9 100644
--- a/include/exec/cpu-all.h
+++ b/include/exec/cpu-all.h
@@ -175,7 +175,7 @@ extern unsigned long reserved_va;
 #define TARGET_ENDIANNESS
 #include "exec/memory_ldst.inc.h"
 
-#define SUFFIX       _cached
+#define SUFFIX       _cached_slow
 #define ARG1         cache
 #define ARG1_DECL    MemoryRegionCache *cache
 #define TARGET_ENDIANNESS
@@ -193,6 +193,10 @@ static inline void stl_phys_notdirty(AddressSpace *as, hwaddr addr, uint32_t val
 #define TARGET_ENDIANNESS
 #include "exec/memory_ldst_phys.inc.h"
 
+/* Inline fast path for direct RAM access.  */
+#define ENDIANNESS
+#include "exec/memory_ldst_cached.inc.h"
+
 #define SUFFIX       _cached
 #define ARG1         cache
 #define ARG1_DECL    MemoryRegionCache *cache