summaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2015-12-09 10:34:13 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2015-12-17 17:33:49 +0100
commit3cc8f884996584630734a90c9b3c535af81e3c92 (patch)
treee71d7f1db7792348e5496d6b4ca2622037081b44 /exec.c
parent1619d1fe737d2af068aefe134386a69b76164794 (diff)
downloadqemu-3cc8f884996584630734a90c9b3c535af81e3c92.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 1597e8ab48..8718a75b64 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;