unicorn/qemu/target/arm
Peter Maydell c6041bf94b
target/arm: Avoid bogus NSACR traps on M-profile without Security Extension
In Arm v8.0 M-profile CPUs without the Security Extension and also in
v7M CPUs, there is no NSACR register. However, the code we have to handle
the FPU does not always check whether the ARM_FEATURE_M_SECURITY bit
is set before testing whether env->v7m.nsacr permits access to the
FPU. This means that for a CPU with an FPU but without the Security
Extension we would always take a bogus fault when trying to stack
the FPU registers on an exception entry.

We could fix this by adding extra feature bit checks for all uses,
but it is simpler to just make the internal value of nsacr 0xcff
("all non-secure accesses allowed"), since this is not guest
visible when the Security Extension is not present. This allows
us to continue to follow the Arm ARM pseudocode which takes a
similar approach. (In particular, in the v8.1 Arm ARM the register
is documented as reading as 0xcff in this configuration.)

Fixes: https://bugs.launchpad.net/qemu/+bug/1838475

Backports commit 02ac2f7f613b47f6a5b397b20ab0e6b2e7fb89fa from qemu
2019-08-08 19:56:56 -04:00
..
arm_ldst.h
arm-powerctl.c
arm-powerctl.h
cpu64.c target/arm: Use env_cpu, env_archcpu 2019-06-12 11:34:08 -04:00
cpu-param.h tcg: Split out target/arch/cpu-param.h 2019-06-10 19:35:46 -04:00
cpu-qom.h
cpu.c target/arm: Avoid bogus NSACR traps on M-profile without Security Extension 2019-08-08 19:56:56 -04:00
cpu.h target/arm: Restrict semi-hosting to TCG 2019-08-08 17:48:34 -04:00
crypto_helper.c
debug_helper.c target/arm: Move debug routines to debug_helper.c 2019-08-08 17:46:56 -04:00
helper-a64.c target/arm: Use env_cpu, env_archcpu 2019-06-12 11:34:08 -04:00
helper-a64.h target/arm: check CF_PARALLEL instead of parallel_cpus 2019-05-04 22:44:32 -04:00
helper-sve.h
helper.c target/arm: Add missing break statement for Hypervisor Trap Exception 2019-08-08 19:43:01 -04:00
helper.h target/arm: Use tcg_gen_abs_i64 and tcg_gen_gvec_abs 2019-05-16 16:43:02 -04:00
internals.h target/arm: Declare some M-profile functions publicly 2019-08-08 15:37:01 -04:00
iwmmxt_helper.c
kvm-consts.h
m_helper.c target/arm: NS BusFault on vector table fetch escalates to NS HardFault 2019-08-08 19:32:53 -04:00
Makefile.objs target/arm/helper: Move M profile routines to m_helper.c 2019-08-08 18:04:08 -04:00
neon_helper.c target/arm: Use tcg_gen_abs_i64 and tcg_gen_gvec_abs 2019-05-16 16:43:02 -04:00
op_addsub.h
op_helper.c target/arm: Deliver BKPT/BRK exceptions to correct exception level 2019-08-08 19:53:30 -04:00
pauth_helper.c target/arm: Fix output of PAuth Auth 2019-06-13 16:17:00 -04:00
psci.c
sve_helper.c tcg: Use tlb_fill probe from tlb_vaddr_to_host 2019-05-16 18:27:03 -04:00
sve.decode target/arm: Sychronize with qemu 2019-04-18 04:49:11 -04:00
tlb_helper.c target/arm: Move TLB related routines to tlb_helper.c 2019-08-08 15:24:26 -04:00
translate-a64.c target/arm: Move vfp_expand_imm() to translate.[ch] 2019-06-25 18:17:49 -05:00
translate-a64.h target/arm: Move vfp_expand_imm() to translate.[ch] 2019-06-25 18:17:49 -05:00
translate-sve.c tcg: Specify optional vector requirements with a list 2019-05-16 15:05:02 -04:00
translate-vfp.inc.c target/arm: Correct VMOV_imm_dp handling of short vectors 2019-08-08 18:08:55 -04:00
translate.c target/arm: Execute Thumb instructions when their condbits are 0xf 2019-08-08 18:07:57 -04:00
translate.h target/arm: Remove unused cpu_F0s, cpu_F0d, cpu_F1s, cpu_F1d 2019-06-25 18:45:53 -05:00
unicorn_aarch64.c
unicorn_arm.c unicorn_arm: Treat registers as unsigned values in casts 2019-04-26 08:48:31 -04:00
unicorn.h
vec_helper.c target/arm: Add helpers for FMLAL 2019-02-28 15:31:48 -05:00
vfp_helper.c target/arm/vfp_helper: Call set_fpscr_to_host before updating to FPSCR 2019-08-08 19:21:28 -04:00
vfp-uncond.decode target/arm: Convert VCVTA/VCVTN/VCVTP/VCVTM to decodetree 2019-06-13 16:54:42 -04:00
vfp.decode target/arm: Use vfp_expand_imm() for AArch32 VFP VMOV_imm 2019-06-25 18:20:19 -05:00