diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2015-12-09 10:34:13 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2015-12-17 17:33:49 +0100 |
commit | 3cc8f884996584630734a90c9b3c535af81e3c92 (patch) | |
tree | e71d7f1db7792348e5496d6b4ca2622037081b44 /exec.c | |
parent | 1619d1fe737d2af068aefe134386a69b76164794 (diff) | |
download | qemu-3cc8f884996584630734a90c9b3c535af81e3c92.zip qemu-3cc8f884996584630734a90c9b3c535af81e3c92.tar.gz qemu-3cc8f884996584630734a90c9b3c535af81e3c92.tar.bz2 |
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.c | 15 |
1 files changed, 2 insertions, 13 deletions
@@ -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; |