]> git.proxmox.com Git - mirror_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)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 19 Aug 2014 17:56:24 +0000 (18:56 +0100)
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
target-arm/translate-a64.c

index f04ca4963158a6e56734a6fcbd5dddb98916a854..2e21948df0566f54886e4593db74f3d230bb732a 100644 (file)
@@ -1456,7 +1456,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) {