summaryrefslogtreecommitdiffstats
path: root/include/exec/exec-all.h
diff options
context:
space:
mode:
authorPeter Maydell2018-08-14 18:17:19 +0200
committerPeter Maydell2018-08-14 18:17:19 +0200
commit55a7cb144d8565583d31c323672745f87fca9954 (patch)
tree9433478562044ee5ff2eddaca0734f84f5217573 /include/exec/exec-all.h
parenttarget/arm: Allow execution from small regions (diff)
downloadqemu-55a7cb144d8565583d31c323672745f87fca9954.tar.gz
qemu-55a7cb144d8565583d31c323672745f87fca9954.tar.xz
qemu-55a7cb144d8565583d31c323672745f87fca9954.zip
accel/tcg: Check whether TLB entry is RAM consistently with how we set it up
We set up TLB entries in tlb_set_page_with_attrs(), where we have some logic for determining whether the TLB entry is considered to be RAM-backed, and thus has a valid addend field. When we look at the TLB entry in get_page_addr_code(), we use different logic for determining whether to treat the page as RAM-backed and use the addend field. This is confusing, and in fact buggy, because the code in tlb_set_page_with_attrs() correctly decides that rom_device memory regions not in romd mode are not RAM-backed, but the code in get_page_addr_code() thinks they are RAM-backed. This typically results in "Bad ram pointer" assertion if the guest tries to execute from such a memory region. Fix this by making get_page_addr_code() just look at the TLB_MMIO bit in the code_address field of the TLB, which tlb_set_page_with_attrs() sets if and only if the addend field is not valid for code execution. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 20180713150945.12348-1-peter.maydell@linaro.org
Diffstat (limited to 'include/exec/exec-all.h')
-rw-r--r--include/exec/exec-all.h2
1 files changed, 0 insertions, 2 deletions
diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h
index da73e3bfed..5f78125582 100644
--- a/include/exec/exec-all.h
+++ b/include/exec/exec-all.h
@@ -502,8 +502,6 @@ hwaddr memory_region_section_get_iotlb(CPUState *cpu,
hwaddr paddr, hwaddr xlat,
int prot,
target_ulong *address);
-bool memory_region_is_unassigned(MemoryRegion *mr);
-
#endif
/* vl.c */