]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
target-mips: fix CP0.BadVAddr by stopping translation on Address Error
authorLeon Alrae <leon.alrae@imgtec.com>
Mon, 16 Mar 2015 16:54:42 +0000 (16:54 +0000)
committerLeon Alrae <leon.alrae@imgtec.com>
Wed, 18 Mar 2015 09:58:15 +0000 (09:58 +0000)
CP0.BadVAddr is supposed to capture the most recent virtual address that caused
the exception. Currently this does not work correctly for unaligned instruction
fetch as translation is not stopped and CP0.BadVAddr is updated with subsequent
addresses.

Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
target-mips/translate.c

index 9059bfd9f1056176fdfaa50a8f1dfdb36411305a..0e2443a032e4fb461d51b0c2b6e19647cb729def 100644 (file)
@@ -18438,6 +18438,7 @@ static void decode_opc(CPUMIPSState *env, DisasContext *ctx)
     if (ctx->pc & 0x3) {
         env->CP0_BadVAddr = ctx->pc;
         generate_exception_err(ctx, EXCP_AdEL, EXCP_INST_NOTAVAIL);
+        ctx->bstate = BS_STOP;
         return;
     }