From: Song Gao <[email protected]> Exception ADEM/ADEF need update CSR_BADV, the value from the virtual address.
Signed-off-by: Song Gao <[email protected]> Signed-off-by: Bibo Mao <[email protected]> Reviewed-by: Bibo Mao <[email protected]> (cherry picked from commit a7be2e0a3f7d0f35bcc3b17e2b558084efc5d9fe) (Mjt: the changes are in target/loongarch/cpu.c in 10.1) Signed-off-by: Michael Tokarev <[email protected]> diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c index 5fb7f69857..9ca85a56a2 100644 --- a/target/loongarch/cpu.c +++ b/target/loongarch/cpu.c @@ -312,6 +312,7 @@ static void loongarch_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr, { CPULoongArchState *env = cpu_env(cs); + env->CSR_BADV = addr; if (access_type == MMU_INST_FETCH) { do_raise_exception(env, EXCCODE_ADEF, retaddr); } else { -- 2.47.3
