From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60598) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMh9v-0003et-3Z for qemu-devel@nongnu.org; Wed, 27 Aug 2014 13:37:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XMh9k-0002yE-EV for qemu-devel@nongnu.org; Wed, 27 Aug 2014 13:37:23 -0400 Received: from e33.co.us.ibm.com ([32.97.110.151]:39413) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMh9k-0002xw-3p for qemu-devel@nongnu.org; Wed, 27 Aug 2014 13:37:12 -0400 Received: from /spool/local by e33.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 27 Aug 2014 11:37:11 -0600 From: Michael Roth Date: Wed, 27 Aug 2014 12:36:10 -0500 Message-Id: <1409160982-16389-14-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1409160982-16389-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1409160982-16389-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 13/25] target-arm: Fix return address for A64 BRK instructions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org From: Peter Maydell When we take an exception resulting from a BRK instruction, the architecture requires that the "preferred return address" reported to the exception handler is the address of the BRK itself, not the following instruction (like undefined insns, and in contrast with SVC, HVC and SMC). Follow this, rather than incorrectly reporting the address of the following insn. (We do get this correct for the A32/T32 BKPT insns.) Signed-off-by: Peter Maydell Cc: qemu-stable@nongnu.org (cherry picked from commit 229a138d740142885dd4e7063e25147d7f71fdef) Signed-off-by: Michael Roth --- target-arm/translate-a64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target-arm/translate-a64.c b/target-arm/translate-a64.c index 33b5025..fc319d5 100644 --- a/target-arm/translate-a64.c +++ b/target-arm/translate-a64.c @@ -1454,7 +1454,7 @@ static void disas_exc(DisasContext *s, uint32_t insn) break; } /* BRK */ - gen_exception_insn(s, 0, EXCP_BKPT, syn_aa64_bkpt(imm16)); + gen_exception_insn(s, 4, EXCP_BKPT, syn_aa64_bkpt(imm16)); break; case 2: if (op2_ll != 0) { -- 1.9.1