target/loongarch: Convert to translate_for_debug

Convert loongarch 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-4-peter.maydell@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
This commit is contained in:
Peter Maydell authored and Philippe Mathieu-Daudé committed 2026-10-24 11:48:48 +02:00
1 parent 9e754ae5dd
commit 079d8046a0
3 files changed
+12 -5

No files matched your search

+2 -1
View File
@@ -99,7 +99,8 @@ TLBRet loongarch_ptw(CPULoongArchState *env, MMUContext *context,
int access_type, int mmu_idx, int debug);
void get_dir_base_width(CPULoongArchState *env, uint64_t *dir_base,
uint64_t *dir_width, unsigned int level);
hwaddr loongarch_cpu_get_phys_addr_debug(CPUState *cpu, vaddr addr);
bool loongarch_cpu_translate_for_debug(CPUState *cpu, vaddr addr,
TranslateForDebugResult *result);
uint64_t loongarch_palen_mask(CPULoongArchState *env);
#endif /* LOONGARCH_CPU_MMU_H */
+1 -1
View File
@@ -882,7 +882,7 @@ static const struct SysemuCPUOps loongarch_sysemu_ops = {
.write_elf64_note = loongarch_cpu_write_elf64_note,
.get_dump_info = loongarch_get_dump_info,
.get_note_size = loongarch_get_note_size,
.get_phys_addr_debug = loongarch_cpu_get_phys_addr_debug,
.translate_for_debug = loongarch_cpu_translate_for_debug,
};
static int64_t loongarch_cpu_get_arch_id(CPUState *cs)
+9 -3
View File
@@ -327,7 +327,8 @@ TLBRet get_physical_address(CPULoongArchState *env, MMUContext *context,
return loongarch_map_address(env, context, access_type, mmu_idx, is_debug);
}
hwaddr loongarch_cpu_get_phys_addr_debug(CPUState *cs, vaddr addr)
bool loongarch_cpu_translate_for_debug(CPUState *cs, vaddr addr,
TranslateForDebugResult *result)
{
CPULoongArchState *env = cpu_env(cs);
MMUContext context;
@@ -335,9 +336,14 @@ hwaddr loongarch_cpu_get_phys_addr_debug(CPUState *cs, vaddr addr)
context.addr = addr;
if (get_physical_address(env, &context, MMU_DATA_LOAD,
cpu_mmu_index(cs, false), 1) != TLBRET_MATCH) {
return -1;
return false;
}
return context.physical;
*result = (TranslateForDebugResult) {
.physaddr = context.physical,
.attrs.debug = 1,
.lg_page_size = TARGET_PAGE_BITS,
};
return true;
}
uint64_t loongarch_palen_mask(CPULoongArchState *env)