From: Richard Henderson Date: Sun, 4 May 2025 16:50:08 +0000 (-0700) Subject: target/loongarch: Fill in TCGCPUOps.pointer_wrap X-Git-Tag: v10.1.0-rc0~73^2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=353f703cf1959228affc23b5bba8a18738736cf4;p=thirdparty%2Fqemu.git target/loongarch: Fill in TCGCPUOps.pointer_wrap Check va32 state. Reviewed-by: Song Gao Reviewed-by: Bibo Mao Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c index f7535d1be77..abad84c0547 100644 --- a/target/loongarch/cpu.c +++ b/target/loongarch/cpu.c @@ -334,6 +334,12 @@ static bool loongarch_cpu_exec_interrupt(CPUState *cs, int interrupt_request) } return false; } + +static vaddr loongarch_pointer_wrap(CPUState *cs, int mmu_idx, + vaddr result, vaddr base) +{ + return is_va32(cpu_env(cs)) ? (uint32_t)result : result; +} #endif static TCGTBCPUState loongarch_get_tb_cpu_state(CPUState *cs) @@ -889,6 +895,7 @@ static const TCGCPUOps loongarch_tcg_ops = { #ifndef CONFIG_USER_ONLY .tlb_fill = loongarch_cpu_tlb_fill, + .pointer_wrap = loongarch_pointer_wrap, .cpu_exec_interrupt = loongarch_cpu_exec_interrupt, .cpu_exec_halt = loongarch_cpu_has_work, .cpu_exec_reset = cpu_reset,