From 9e095560bbae211559bd98f9ffb199eed9fc5f0a Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Thu, 30 Apr 2026 10:38:06 +0100 Subject: [PATCH] hw/xtensa: Use cpu_translate_for_debug() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We want to remove the cpu_get_phys_addr_debug() function; update the xtensa boards to use cpu_translate_for_debug() instead. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20260430093810.2762539-22-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daudé --- hw/xtensa/sim.c | 6 +++++- hw/xtensa/xtfpga.c | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/hw/xtensa/sim.c b/hw/xtensa/sim.c index 32eb16442f..835cd04fe0 100644 --- a/hw/xtensa/sim.c +++ b/hw/xtensa/sim.c @@ -40,8 +40,12 @@ static uint64_t translate_phys_addr(void *opaque, uint64_t addr) { XtensaCPU *cpu = opaque; + TranslateForDebugResult tres; - return cpu_get_phys_addr_debug(CPU(cpu), addr); + if (!cpu_translate_for_debug(CPU(cpu), addr, &tres)) { + return -1; + } + return tres.physaddr; } static void sim_reset(void *opaque) diff --git a/hw/xtensa/xtfpga.c b/hw/xtensa/xtfpga.c index 256497e162..33a2d9485c 100644 --- a/hw/xtensa/xtfpga.c +++ b/hw/xtensa/xtfpga.c @@ -191,8 +191,12 @@ static PFlashCFI01 *xtfpga_flash_init(MemoryRegion *address_space, static uint64_t translate_phys_addr(void *opaque, uint64_t addr) { XtensaCPU *cpu = opaque; + TranslateForDebugResult tres; - return cpu_get_phys_addr_debug(CPU(cpu), addr); + if (!cpu_translate_for_debug(CPU(cpu), addr, &tres)) { + return -1; + } + return tres.physaddr; } static void xtfpga_reset(void *opaque)