]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
target-arm: Fix return address for A64 BRK instructions
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 19 Aug 2014 17:56:24 +0000 (18:56 +0100)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Mon, 8 Sep 2014 16:23:05 +0000 (11:23 -0500)
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 <peter.maydell@linaro.org>
Cc: qemu-stable@nongnu.org
(cherry picked from commit 229a138d740142885dd4e7063e25147d7f71fdef)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
target-arm/translate-a64.c

index 33b5025fee6014bc1867a6b0620eead3a733a34b..fc319d5b2fa4cf479f773f6f7e4cfbc36b62e734 100644 (file)
@@ -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) {