From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56852) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYF6q-0006Cj-Ur for qemu-devel@nongnu.org; Wed, 18 Mar 2015 10:38:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YYF6o-0005Bc-FW for qemu-devel@nongnu.org; Wed, 18 Mar 2015 10:38:12 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:41496) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYF6o-0005BY-6k for qemu-devel@nongnu.org; Wed, 18 Mar 2015 10:38:10 -0400 Received: from KLMAIL01.kl.imgtec.org (unknown [192.168.5.35]) by Websense Email Security Gateway with ESMTPS id 1B48D56537EEE for ; Wed, 18 Mar 2015 14:38:06 +0000 (GMT) From: Leon Alrae Date: Wed, 18 Mar 2015 14:37:31 +0000 Message-ID: <1426689453-9347-2-git-send-email-leon.alrae@imgtec.com> In-Reply-To: <1426689453-9347-1-git-send-email-leon.alrae@imgtec.com> References: <1426689453-9347-1-git-send-email-leon.alrae@imgtec.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PULL 1/3] target-mips: fix CP0.BadVAddr by stopping translation on Address Error List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 --- target-mips/translate.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target-mips/translate.c b/target-mips/translate.c index 9059bfd..0e2443a 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; } -- 2.1.0