Commit a0c9fc28bc for qemu.org

commit a0c9fc28bcc565e74c18d4f6ee67a4e7f6187403
Author: Peter Maydell <peter.maydell@linaro.org>
Date:   Thu Apr 30 10:38:07 2026 +0100

    target/xtensa/xtensa-semi: Use cpu_translate_for_debug()

    We want to remove the cpu_get_phys_addr_debug() function; update the
    xtensa semihosting code to use cpu_translate_for_debug() instead.

    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-ID: <20260430093810.2762539-23-peter.maydell@linaro.org>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

diff --git a/target/xtensa/xtensa-semi.c b/target/xtensa/xtensa-semi.c
index 9a6a9c8b4e..3340bd1d41 100644
--- a/target/xtensa/xtensa-semi.c
+++ b/target/xtensa/xtensa-semi.c
@@ -215,15 +215,20 @@ void HELPER(simcall)(CPUXtensaState *env)
             uint32_t len_done = 0;

             while (len > 0) {
-                hwaddr paddr = cpu_get_phys_addr_debug(cs, vaddr);
+                TranslateForDebugResult tres;
                 uint32_t page_left =
                     TARGET_PAGE_SIZE - (vaddr & (TARGET_PAGE_SIZE - 1));
                 uint32_t io_sz = page_left < len ? page_left : len;
                 hwaddr sz = io_sz;
-                void *buf = address_space_map(as, paddr, &sz, !is_write, attrs);
+                void *buf = NULL;
                 uint32_t io_done;
                 bool error = false;

+                if (cpu_translate_for_debug(cs, vaddr, &tres)) {
+                    buf = address_space_map(as, tres.physaddr, &sz,
+                                            !is_write, attrs);
+                }
+
                 if (buf) {
                     vaddr += io_sz;
                     len -= io_sz;