]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
monitor/hmp-cmds: Use cpu_translate_for_debug()
authorPeter Maydell <peter.maydell@linaro.org>
Thu, 30 Apr 2026 09:38:08 +0000 (10:38 +0100)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 12 May 2026 20:35:54 +0000 (22:35 +0200)
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>
monitor/hmp-cmds.c

index 88f9788bd9ce8e736b6e98c3c1b7bc6e40cd80f7..443b8c785dcb981800a57f4e73f4a4e08514a153 100644 (file)
@@ -764,18 +764,17 @@ void hmp_gva2gpa(Monitor *mon, const QDict *qdict)
 {
     vaddr addr = qdict_get_int(qdict, "addr");
     CPUState *cs = mon_get_cpu(mon);
-    hwaddr gpa;
+    TranslateForDebugResult tres;
 
     if (!cs) {
         monitor_printf(mon, "No cpu\n");
         return;
     }
 
-    gpa  = cpu_get_phys_addr_debug(cs, addr);
-    if (gpa == -1) {
+    if (!cpu_translate_for_debug(cs, addr, &tres)) {
         monitor_printf(mon, "Unmapped\n");
     } else {
-        monitor_printf(mon, "gpa: 0x%" HWADDR_PRIx "\n", gpa);
+        monitor_printf(mon, "gpa: 0x%" HWADDR_PRIx "\n", tres.physaddr);
     }
 }