Commit 85ba1f38ee for qemu.org

commit 85ba1f38ee0a5839d289294845b6b747cfeecb82
Author: Peter Maydell <peter.maydell@linaro.org>
Date:   Tue Oct 20 13:27:48 2026 +0100

    target/alpha: Convert to translate_for_debug

    Convert alpha to providing the translate_for_debug method rather than
    the deprecated get_phys_addr_debug method.

    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
    Message-ID: <20261020122752.3651914-2-peter.maydell@linaro.org>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>

diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c
index 6e514dcf4c..fd099c8e70 100644
--- a/target/alpha/cpu.c
+++ b/target/alpha/cpu.c
@@ -242,7 +242,7 @@ static void alpha_cpu_initfn(Object *obj)

 static const struct SysemuCPUOps alpha_sysemu_ops = {
     .has_work = alpha_cpu_has_work,
-    .get_phys_addr_debug = alpha_cpu_get_phys_addr_debug,
+    .translate_for_debug = alpha_cpu_translate_for_debug,
 };
 #endif

diff --git a/target/alpha/cpu.h b/target/alpha/cpu.h
index 8f78050247..5b2280c609 100644
--- a/target/alpha/cpu.h
+++ b/target/alpha/cpu.h
@@ -282,7 +282,8 @@ extern const VMStateDescription vmstate_alpha_cpu;

 void alpha_cpu_do_interrupt(CPUState *cpu);
 bool alpha_cpu_exec_interrupt(CPUState *cpu, int int_req);
-hwaddr alpha_cpu_get_phys_addr_debug(CPUState *cpu, vaddr addr);
+bool alpha_cpu_translate_for_debug(CPUState *cpu, vaddr addr,
+                                   TranslateForDebugResult *result);
 #endif /* !CONFIG_USER_ONLY */
 const char *alpha_exception_name(int exception);
 void alpha_cpu_dump_state(CPUState *cs, FILE *f, int flags);
diff --git a/target/alpha/helper.c b/target/alpha/helper.c
index 84997ef3a9..d59ecc0d4a 100644
--- a/target/alpha/helper.c
+++ b/target/alpha/helper.c
@@ -317,14 +317,25 @@ static int get_physical_address(CPUAlphaState *env, vaddr addr,
     return ret;
 }

-hwaddr alpha_cpu_get_phys_addr_debug(CPUState *cs, vaddr addr)
+bool alpha_cpu_translate_for_debug(CPUState *cs, vaddr addr,
+                                   TranslateForDebugResult *result)
 {
     hwaddr phys;
     int prot, fail;

     fail = get_physical_address(cpu_env(cs), addr, 0, 0, &phys, &prot);
+    if (fail >= 0) {
+        return false;
+    }
+
     phys |= addr & ~TARGET_PAGE_MASK;
-    return (fail >= 0 ? -1 : phys);
+
+    *result = (TranslateForDebugResult) {
+        .physaddr = phys,
+        .lg_page_size = TARGET_PAGE_BITS,
+        .attrs.debug = 1,
+    };
+    return true;
 }

 bool alpha_cpu_tlb_fill(CPUState *cs, vaddr addr, int size,