Message ID | 20200706200559.160209-2-laurent@vivier.eu |
---|---|
State | New |
Headers | show |
Series | [PULL,1/3] target/m68k: fix physical address translation in m68k_cpu_get_phys_page_debug() | expand |
diff --git a/target/m68k/helper.c b/target/m68k/helper.c index 79b0b10ea9bc..631eab777494 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; }