monitor/hmp-cmds: Use cpu_translate_for_debug()
We want to remove the cpu_get_phys_addr_debug() function; update the HMP gva2gpa command implementation to use cpu_translate_for_debug() instead. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20260430093810.2762539-24-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Peter Maydell committed
Apr 30, 2026 at 10:38 UTC
a4c857aef058fa7ccee50ea8d01bd78302ce032a
1 file changed
+3
-4
monitor/hmp-cmds.c
+3
-4
@@ -764,18 +764,17 @@ void hmp_gva2gpa(Monitor *mon, const QDict *qdict)
764
{
765
vaddr addr = qdict_get_int(qdict, "addr");
766
CPUState *cs = mon_get_cpu(mon);
767
- hwaddr gpa;
767
+ TranslateForDebugResult tres;
768
769
if (!cs) {
770
monitor_printf(mon, "No cpu\n");
771
return;
772
}
773
774
- gpa = cpu_get_phys_addr_debug(cs, addr);
775
- if (gpa == -1) {
774
+ if (!cpu_translate_for_debug(cs, addr, &tres)) {
775
monitor_printf(mon, "Unmapped\n");
776
} else {
778
- monitor_printf(mon, "gpa: 0x%" HWADDR_PRIx "\n", gpa);
777
+ monitor_printf(mon, "gpa: 0x%" HWADDR_PRIx "\n", tres.physaddr);
778
}
779
}
780