summaryrefslogtreecommitdiffstats
path: root/exec.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2015-12-09 10:34:13 +0100
committerTimothy Pearson <tpearson@raptorengineering.com>2019-11-29 19:28:20 -0600
commit8f59b057156e4d88e019ade92f74bdf32b11f870 (patch)
tree4cb68716e6f99fabc2798dcd9c9a85cc420252aa /exec.c
parentbb69e6231b90bf627b751cd362980789a6a780d9 (diff)
downloadhqemu-8f59b057156e4d88e019ade92f74bdf32b11f870.zip
hqemu-8f59b057156e4d88e019ade92f74bdf32b11f870.tar.gz
memory: try to inline constant-length reads
memcpy can take a large amount of time for small reads and writes. Handle the common case of reading s/g descriptors from memory (there is no corresponding "write" case that is as common, because writes often use address_space_st* functions) by inlining the relevant parts of address_space_read into the caller. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/exec.c b/exec.c
index 86adbf1..0d3e433 100644
--- a/exec.c
+++ b/exec.c
@@ -390,17 +390,6 @@ address_space_translate_internal(AddressSpaceDispatch *d, hwaddr addr, hwaddr *x
return section;
}
-static inline bool memory_access_is_direct(MemoryRegion *mr, bool is_write)
-{
- if (is_write) {
- return memory_region_is_ram(mr) && !mr->readonly;
- } else {
- return memory_region_is_ram(mr) || memory_region_is_romd(mr);
- }
-
- return false;
-}
-
/* Called from RCU critical section */
MemoryRegion *address_space_translate(AddressSpace *as, hwaddr addr,
hwaddr *xlat, hwaddr *plen,
@@ -2632,8 +2621,8 @@ MemTxResult address_space_read_continue(AddressSpace *as, hwaddr addr,
return result;
}
-MemTxResult address_space_read(AddressSpace *as, hwaddr addr, MemTxAttrs attrs,
- uint8_t *buf, int len)
+MemTxResult address_space_read_full(AddressSpace *as, hwaddr addr,
+ MemTxAttrs attrs, uint8_t *buf, int len)
{
hwaddr l;
hwaddr addr1;
OpenPOWER on IntegriCloud