qemu/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-powerctl.c
arm-powerctl.h
arm-semi.c
arm_ldst.h
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 target/arm: Restrict semi-hosting to TCG 2019-07-04 17:14:43 +01:00
cpu64.c
crypto_helper.c
debug_helper.c target/arm: Move debug routines to debug_helper.c 2019-07-04 17:14:43 +01:00
gdbstub.c
gdbstub64.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 target/arm: Declare some M-profile functions publicly 2019-07-01 17:29:01 +01:00
iwmmxt_helper.c
kvm-consts.h
kvm-stub.c
kvm.c
kvm32.c KVM: Introduce kvm_arch_destroy_vcpu() 2019-06-21 02:29:39 +02:00
kvm64.c KVM: Introduce kvm_arch_destroy_vcpu() 2019-06-21 02:29:39 +02:00
kvm_arm.h
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 target/arm/helper: Move M profile routines to m_helper.c 2019-07-04 17:14:43 +01:00
monitor.c qapi: Rename target.json to misc-target.json 2019-07-02 13:37:00 +02:00
neon_helper.c
op_addsub.h
op_helper.c target/arm: Move debug routines to debug_helper.c 2019-07-04 17:14:43 +01:00
pauth_helper.c
psci.c
sve.decode
sve_helper.c tcg: Introduce set/clear_helper_retaddr 2019-07-14 12:19:00 +02:00
tlb_helper.c target/arm: Move TLB related routines to tlb_helper.c 2019-07-01 17:29:01 +01:00
trace-events
translate-a64.c target/arm: Move CPU state dumping routines to cpu.c 2019-07-01 17:29:00 +01:00
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 target/arm: Move CPU state dumping routines to cpu.c 2019-07-01 17:29:00 +01:00
vec_helper.c
vfp-uncond.decode
vfp.decode
vfp_helper.c target/arm/vfp_helper: Call set_fpscr_to_host before updating to FPSCR 2019-07-08 14:11:31 +01:00