diff options
author | Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> | 2020-07-01 21:15:30 +0100 |
---|---|---|
committer | Laurent Vivier <laurent@vivier.eu> | 2020-07-06 21:39:19 +0200 |
commit | 78318119eead6aed050d1730a6b72d1c555302d2 (patch) | |
tree | 4f9c49c690aaae835ffc317f1f06d2209dab850c /target | |
parent | 64f0ad8ad8e13257e7c912df470d46784b55c3fd (diff) | |
download | qemu-78318119eead6aed050d1730a6b72d1c555302d2.zip qemu-78318119eead6aed050d1730a6b72d1c555302d2.tar.gz qemu-78318119eead6aed050d1730a6b72d1c555302d2.tar.bz2 |
target/m68k: fix physical address translation in m68k_cpu_get_phys_page_debug()
The result of the get_physical_address() function should be combined with the
offset of the original page access before being returned. Otherwise the
m68k_cpu_get_phys_page_debug() function can round to the wrong page causing
incorrect lookups in gdbstub and various "Disassembler disagrees with
translator over instruction decoding" warnings to appear at translation time.
Fixes: 88b2fef6c3 ("target/m68k: add MC68040 MMU")
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20200701201531.13828-2-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'target')
-rw-r--r-- | target/m68k/helper.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/target/m68k/helper.c b/target/m68k/helper.c index 79b0b10..631eab7 100644 --- a/target/m68k/helper.c +++ b/target/m68k/helper.c @@ -820,10 +820,14 @@ hwaddr m68k_cpu_get_phys_page_debug(CPUState *cs, vaddr addr) if (env->sr & SR_S) { access_type |= ACCESS_SUPER; } + if (get_physical_address(env, &phys_addr, &prot, addr, access_type, &page_size) != 0) { return -1; } + + addr &= TARGET_PAGE_MASK; + phys_addr += addr & (page_size - 1); return phys_addr; } |