]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
monitor: hmp_gva2gpa: Don't page-align cpu_get_phys_addr_debug() arg and return
authorPeter Maydell <peter.maydell@linaro.org>
Thu, 30 Apr 2026 09:37:58 +0000 (10:37 +0100)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 12 May 2026 20:35:54 +0000 (22:35 +0200)
In hmp_gva2gpa() we currently have a workaround for not all implementations
of get_phys_addr_debug handling non-page-aligned addresses: we round the
input address from the user down to the target page boundary before the
call and then add the page offset back to the returned value.

Now that we guarantee that all implementations will return the correct
exact physaddr for a virtual address, we can drop this handling.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Dr. David Alan Gilbert <dave@treblig.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20260417173105.1648172-13-peter.maydell@linaro.org
Message-ID: <20260430093810.2762539-14-peter.maydell@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
monitor/hmp-cmds.c

index b37a9985c0d14e011e5760f88ece2ab3c2ec5bef..88f9788bd9ce8e736b6e98c3c1b7bc6e40cd80f7 100644 (file)
@@ -771,12 +771,11 @@ void hmp_gva2gpa(Monitor *mon, const QDict *qdict)
         return;
     }
 
-    gpa  = cpu_get_phys_addr_debug(cs, addr & TARGET_PAGE_MASK);
+    gpa  = cpu_get_phys_addr_debug(cs, addr);
     if (gpa == -1) {
         monitor_printf(mon, "Unmapped\n");
     } else {
-        monitor_printf(mon, "gpa: 0x%" HWADDR_PRIx "\n",
-                       gpa + (addr & ~TARGET_PAGE_MASK));
+        monitor_printf(mon, "gpa: 0x%" HWADDR_PRIx "\n", gpa);
     }
 }