[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 09/10] target/arm: Set FSR for BKPT, BRK when raising
From: |
Peter Maydell |
Subject: |
[Qemu-devel] [PULL 09/10] target/arm: Set FSR for BKPT, BRK when raising exception |
Date: |
Fri, 23 Mar 2018 18:49:57 +0000 |
Now that we have a helper function specifically for the BRK and
BKPT instructions, we can set the exception.fsr there rather
than in arm_cpu_do_interrupt_aarch32(). This allows us to
use our new arm_debug_exception_fsr() helper.
In particular this fixes a bug where we were hardcoding the
short-form IFSR value, which is wrong if the target exception
level has LPAE enabled.
Fixes: https://bugs.launchpad.net/qemu/+bug/1756927
Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Message-id: address@hidden
---
target/arm/helper.c | 1 -
target/arm/op_helper.c | 2 ++
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/target/arm/helper.c b/target/arm/helper.c
index 09893e3f72..dcb8476d9e 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -7910,7 +7910,6 @@ static void arm_cpu_do_interrupt_aarch32(CPUState *cs)
offset = 0;
break;
case EXCP_BKPT:
- env->exception.fsr = 2;
/* Fall through to prefetch abort. */
case EXCP_PREFETCH_ABORT:
A32_BANKED_CURRENT_REG_SET(env, ifsr, env->exception.fsr);
diff --git a/target/arm/op_helper.c b/target/arm/op_helper.c
index 75efff9edf..8e1e521193 100644
--- a/target/arm/op_helper.c
+++ b/target/arm/op_helper.c
@@ -488,6 +488,8 @@ void HELPER(exception_with_syndrome)(CPUARMState *env,
uint32_t excp,
*/
void HELPER(exception_bkpt_insn)(CPUARMState *env, uint32_t syndrome)
{
+ /* FSR will only be used if the debug target EL is AArch32. */
+ env->exception.fsr = arm_debug_exception_fsr(env);
raise_exception(env, EXCP_BKPT, syndrome, arm_debug_target_el(env));
}
--
2.16.2
- [Qemu-devel] [PULL 00/10] target-arm queue, Peter Maydell, 2018/03/23
- [Qemu-devel] [PULL 02/10] sdhci: fix incorrect use of Error *, Peter Maydell, 2018/03/23
- [Qemu-devel] [PULL 03/10] hw/intc/arm_gicv3: Fix secure-GIC NS ICC_PMR and ICC_RPR accesses, Peter Maydell, 2018/03/23
- [Qemu-devel] [PULL 04/10] hw/arm/bcm2836: Use the Cortex-A7 instead of Cortex-A15, Peter Maydell, 2018/03/23
- [Qemu-devel] [PULL 05/10] i.MX: Support serial RS-232 break properly, Peter Maydell, 2018/03/23
- [Qemu-devel] [PULL 07/10] target/arm: Honour MDCR_EL2.TDE when routing exceptions due to BKPT/BRK, Peter Maydell, 2018/03/23
- [Qemu-devel] [PULL 01/10] arm/translate-a64: treat DISAS_UPDATE as variant of DISAS_EXIT, Peter Maydell, 2018/03/23
- [Qemu-devel] [PULL 10/10] target/arm: Always set FAR to a known unknown value for debug exceptions, Peter Maydell, 2018/03/23
- [Qemu-devel] [PULL 08/10] target/arm: Factor out code to calculate FSR for debug exceptions, Peter Maydell, 2018/03/23
- [Qemu-devel] [PULL 06/10] mach-virt: Set VM's SMBIOS system version to mc->name, Peter Maydell, 2018/03/23
- [Qemu-devel] [PULL 09/10] target/arm: Set FSR for BKPT, BRK when raising exception,
Peter Maydell <=
- Re: [Qemu-devel] [PULL 00/10] target-arm queue, no-reply, 2018/03/23
- Re: [Qemu-devel] [PULL 00/10] target-arm queue, Peter Maydell, 2018/03/25