From: Peter Maydell <[email protected]> We want to remove the cpu_get_phys_addr_debug() function; update the sparc dump_mmu() function to use cpu_translate_for_debug() instead.
The "mmu_probe succeeds but debug translate fails" cases are probably not possible in practice; since cpu_get_phys_addr_debug() would return -1 in that situation we make this conversion retain that behaviour. Signed-off-by: Peter Maydell <[email protected]> Reviewed-by: Richard Henderson <[email protected]> Message-ID: <[email protected]> Signed-off-by: Philippe Mathieu-Daudé <[email protected]> --- target/sparc/mmu_helper.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/target/sparc/mmu_helper.c b/target/sparc/mmu_helper.c index e1abd520c49..e441ffb8f7e 100644 --- a/target/sparc/mmu_helper.c +++ b/target/sparc/mmu_helper.c @@ -360,26 +360,39 @@ void dump_mmu(CPUSPARCState *env) unsigned int n, m, o; hwaddr pa; uint32_t pde; + TranslateForDebugResult tres; qemu_printf("Root ptr: " HWADDR_FMT_plx ", ctx: %d\n", (hwaddr)env->mmuregs[1] << 4, env->mmuregs[2]); for (n = 0, va = 0; n < 256; n++, va += 16 * 1024 * 1024) { pde = mmu_probe(env, va, 2); if (pde) { - pa = cpu_get_phys_addr_debug(cs, va); + if (!cpu_translate_for_debug(cs, va, &tres)) { + pa = -1; + } else { + pa = tres.physaddr; + } qemu_printf("VA: " TARGET_FMT_lx ", PA: " HWADDR_FMT_plx " PDE: " TARGET_FMT_lx "\n", va, pa, pde); for (m = 0, va1 = va; m < 64; m++, va1 += 256 * 1024) { pde = mmu_probe(env, va1, 1); if (pde) { - pa = cpu_get_phys_addr_debug(cs, va1); + if (!cpu_translate_for_debug(cs, va1, &tres)) { + pa = -1; + } else { + pa = tres.physaddr; + } qemu_printf(" VA: " TARGET_FMT_lx ", PA: " HWADDR_FMT_plx " PDE: " TARGET_FMT_lx "\n", va1, pa, pde); for (o = 0, va2 = va1; o < 64; o++, va2 += 4 * 1024) { pde = mmu_probe(env, va2, 0); if (pde) { - pa = cpu_get_phys_addr_debug(cs, va2); + if (!cpu_translate_for_debug(cs, va2, &tres)) { + pa = -1; + } else { + pa = tres.physaddr; + } qemu_printf(" VA: " TARGET_FMT_lx ", PA: " HWADDR_FMT_plx " PTE: " TARGET_FMT_lx "\n", -- 2.53.0
