Commit 9e754ae5dd for qemu.org

commit 9e754ae5ddf2ad9b963c0d594d54786be6683399
Author: Peter Maydell <peter.maydell@linaro.org>
Date:   Thu Oct 22 13:58:55 2026 +0100

    target/hppa: Convert to translate_for_debug

    Convert hppa 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: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
    Message-ID: <20261022125858.310252-3-peter.maydell@linaro.org>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>

diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c
index dbf86941cf..9d64322398 100644
--- a/target/hppa/cpu.c
+++ b/target/hppa/cpu.c
@@ -246,7 +246,7 @@ static ObjectClass *hppa_cpu_class_by_name(const char *cpu_model)

 static const struct SysemuCPUOps hppa_sysemu_ops = {
     .has_work = hppa_cpu_has_work,
-    .get_phys_addr_debug = hppa_cpu_get_phys_addr_debug,
+    .translate_for_debug = hppa_cpu_translate_for_debug,
 };
 #endif

diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h
index 3914b3285c..8818d47dcd 100644
--- a/target/hppa/cpu.h
+++ b/target/hppa/cpu.h
@@ -391,7 +391,8 @@ int hppa_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
 void hppa_cpu_dump_state(CPUState *cs, FILE *f, int);
 #ifndef CONFIG_USER_ONLY
 void hppa_ptlbe(CPUHPPAState *env);
-hwaddr hppa_cpu_get_phys_addr_debug(CPUState *cs, vaddr addr);
+bool hppa_cpu_translate_for_debug(CPUState *cs, vaddr addr,
+                                  TranslateForDebugResult *result);
 void hppa_set_ior_and_isr(CPUHPPAState *env, vaddr addr, bool mmu_disabled);
 bool hppa_cpu_tlb_fill_align(CPUState *cs, CPUTLBEntryFull *out, vaddr addr,
                              MMUAccessType access_type, int mmu_idx,
diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c
index 01e6149c81..2393a15507 100644
--- a/target/hppa/mem_helper.c
+++ b/target/hppa/mem_helper.c
@@ -346,7 +346,8 @@ int hppa_get_physical_address(CPUHPPAState *env, vaddr addr, int mmu_idx,
     return ret;
 }

-hwaddr hppa_cpu_get_phys_addr_debug(CPUState *cs, vaddr addr)
+bool hppa_cpu_translate_for_debug(CPUState *cs, vaddr addr,
+                                  TranslateForDebugResult *result)
 {
     HPPACPU *cpu = HPPA_CPU(cs);
     hwaddr phys;
@@ -361,10 +362,20 @@ hwaddr hppa_cpu_get_phys_addr_debug(CPUState *cs, vaddr addr)
     excp = hppa_get_physical_address(&cpu->env, addr, mmu_idx, 0, 0,
                                      &phys, &prot);

-    /* Since we're translating for debugging, the only error that is a
-       hard error is no translation at all.  Otherwise, while a real cpu
-       access might not have permission, the debugger does.  */
-    return excp == EXCP_DTLB_MISS ? -1 : phys;
+    /*
+     * Since we're translating for debugging, the only error that is a
+     * hard error is no translation at all.  Otherwise, while a real cpu
+     * access might not have permission, the debugger does.
+     */
+    if (excp == EXCP_DTLB_MISS) {
+        return false;
+    }
+    *result = (TranslateForDebugResult) {
+        .physaddr = phys,
+        .lg_page_size = TARGET_PAGE_BITS,
+        .attrs.debug = 1,
+    };
+    return true;
 }

 void hppa_set_ior_and_isr(CPUHPPAState *env, vaddr addr, bool mmu_disabled)