From: Song Gao Date: Tue, 30 Dec 2025 11:30:01 +0000 (+0800) Subject: target/loongarch: Fix exception BCE missing to update CSR_BADV X-Git-Tag: v11.0.0-rc0~109^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e4f0ef58d53eb20056f9f3ca9f21dbbbf25f2530;p=thirdparty%2Fqemu.git target/loongarch: Fix exception BCE missing to update CSR_BADV Exception BCE need update CSR_BADV, and the value is env->pc. Signed-off-by: Song Gao Signed-off-by: Bibo Mao Reviewed-by: Bibo Mao --- diff --git a/target/loongarch/tcg/tcg_cpu.c b/target/loongarch/tcg/tcg_cpu.c index d91cb9904f0..4b4bf39d097 100644 --- a/target/loongarch/tcg/tcg_cpu.c +++ b/target/loongarch/tcg/tcg_cpu.c @@ -113,6 +113,9 @@ static void loongarch_cpu_do_interrupt(CPUState *cs) cause = cs->exception_index; update_badinstr = 0; break; + case EXCCODE_BCE: + env->CSR_BADV = env->pc; + QEMU_FALLTHROUGH; case EXCCODE_SYS: case EXCCODE_BRK: case EXCCODE_INE: @@ -121,7 +124,6 @@ static void loongarch_cpu_do_interrupt(CPUState *cs) case EXCCODE_FPE: case EXCCODE_SXD: case EXCCODE_ASXD: - case EXCCODE_BCE: case EXCCODE_ADEM: case EXCCODE_PIL: case EXCCODE_PIS: