summaryrefslogtreecommitdiff
path: root/target-mips
diff options
context:
space:
mode:
authorLeon Alrae <leon.alrae@imgtec.com>2015-03-16 16:54:42 +0000
committerLeon Alrae <leon.alrae@imgtec.com>2015-03-18 09:58:15 +0000
commit62c688693bf2f0355fc5bad5dcc59c1cd2a51f1a (patch)
tree5d1a8d8b31e7d2ae028380bb7d1a030a1858edc2 /target-mips
parent5a4992834daec85c3913654903fb9f4f954e585a (diff)
downloadqemu-62c688693bf2f0355fc5bad5dcc59c1cd2a51f1a.zip
target-mips: fix CP0.BadVAddr by stopping translation on Address Error
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>
Diffstat (limited to 'target-mips')
-rw-r--r--target-mips/translate.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/target-mips/translate.c b/target-mips/translate.c
index 9059bfd9f1..0e2443a032 100644
--- a/target-mips/translate.c
+++ b/target-mips/translate.c
@@ -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;
}