qemu-e2k/target/arm
Peter Maydell 51c9122e92 target/arm: NS BusFault on vector table fetch escalates to NS HardFault
In the M-profile architecture, when we do a vector table fetch and it
fails, we need to report a HardFault.  Whether this is a Secure HF or
a NonSecure HF depends on several things.  If AIRCR.BFHFNMINS is 0
then HF is always Secure, because there is no NonSecure HardFault.
Otherwise, the answer depends on whether the 'underlying exception'
(MemManage, BusFault, SecureFault) targets Secure or NonSecure.  (In
the pseudocode, this is handled in the Vector() function: the final
exc.isSecure is calculated by looking at the exc.isSecure from the
exception returned from the memory access, not the isSecure input
argument.)

We weren't doing this correctly, because we were looking at
the target security domain of the exception we were trying to
load the vector table entry for. This produces errors of two kinds:
 * a load from the NS vector table which hits the "NS access
   to S memory" SecureFault should end up as a Secure HardFault,
   but we were raising an NS HardFault
 * a load from the S vector table which causes a BusFault
   should raise an NS HardFault if BFHFNMINS == 1 (because
   in that case all BusFaults are NonSecure), but we were raising
   a Secure HardFault

Correct the logic.

We also fix a comment error where we claimed that we might
be escalating MemManage to HardFault, and forgot about SecureFault.
(Vector loads can never hit MPU access faults, because they're
always aligned and always use the default address map.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20190705094823.28905-1-peter.maydell@linaro.org
2019-07-15 14:17:04 +01:00
..
arch_dump.c
arm_ldst.h
arm-powerctl.c
arm-powerctl.h
arm-semi.c
cpu64.c
cpu-param.h
cpu-qom.h
cpu.c target/arm: Set VFP-related MVFR0 fields for arm926 and arm1026 2019-07-15 14:17:04 +01:00
cpu.h
crypto_helper.c
debug_helper.c
gdbstub64.c
gdbstub.c
helper-a64.c tcg: Introduce set/clear_helper_retaddr 2019-07-14 12:19:00 +02:00
helper-a64.h
helper-sve.h
helper.c target/arm: Fix sve_zcr_len_for_el 2019-07-08 14:11:30 +01:00
helper.h
idau.h
internals.h
iwmmxt_helper.c
kvm32.c
kvm64.c
kvm_arm.h
kvm-consts.h
kvm-stub.c
kvm.c
m_helper.c target/arm: NS BusFault on vector table fetch escalates to NS HardFault 2019-07-15 14:17:04 +01:00
machine.c
Makefile.objs
monitor.c
neon_helper.c
op_addsub.h
op_helper.c
pauth_helper.c
psci.c
sve_helper.c tcg: Introduce set/clear_helper_retaddr 2019-07-14 12:19:00 +02:00
sve.decode
tlb_helper.c
trace-events
translate-a64.c
translate-a64.h
translate-sve.c
translate-vfp.inc.c target/arm: Correct VMOV_imm_dp handling of short vectors 2019-07-04 17:25:30 +01:00
translate.c target/arm: Execute Thumb instructions when their condbits are 0xf 2019-07-04 17:25:30 +01:00
translate.h
vec_helper.c
vfp_helper.c target/arm/vfp_helper: Call set_fpscr_to_host before updating to FPSCR 2019-07-08 14:11:31 +01:00
vfp-uncond.decode
vfp.decode