qemu/target/arm
Peter Maydell f2b4a98930 target/arm: Allow access to SPSR_hyp from hyp mode
Architecturally, the AArch32 MSR/MRS to/from banked register
instructions are UNPREDICTABLE for attempts to access a banked
register that the guest could access in a more direct way (e.g.
using this insn to access r8_fiq when already in FIQ mode).  QEMU has
chosen to UNDEF on all of these.

However, for the case of accessing SPSR_hyp from hyp mode, it turns
out that real hardware permits this, with the same effect as if the
guest had directly written to SPSR. Further, there is some
guest code out there that assumes it can do this, because it
happens to work on hardware: an example Cortex-R52 startup code
fragment uses this, and it got copied into various other places,
including Zephyr. Zephyr was fixed to not use this:
 https://github.com/zephyrproject-rtos/zephyr/issues/47330
but other examples are still out there, like the selftest
binary for the MPS3-AN536.

For convenience of being able to run guest code, permit
this UNPREDICTABLE access instead of UNDEFing it.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20240206132931.38376-5-peter.maydell@linaro.org
2024-02-15 14:32:38 +00:00
..
hvf target/arm: Move GTimer definitions to new 'gtimer.h' header 2024-01-26 11:30:49 +00:00
tcg target/arm: Allow access to SPSR_hyp from hyp mode 2024-02-15 14:32:38 +00:00
arch_dump.c target/arm: Move feature test functions to their own header 2023-10-27 11:44:32 +01:00
arm-powerctl.c target/arm: Expose arm_cpu_mp_affinity() in 'multiprocessing.h' header 2024-01-26 11:30:48 +00:00
arm-powerctl.h target/arm/arm-powerctl: Add new arm_set_cpu_on_and_reset() 2019-02-28 11:03:04 +00:00
arm-qmp-cmds.c target: Use generic cpu_model_from_type() 2024-01-05 16:20:14 +01:00
common-semi-target.h target/arm/common-semi-target.h: Remove unnecessary boot.h include 2023-10-19 14:32:13 +01:00
cortex-regs.c target/arm: Saturate L2CTLR_EL1 core count field rather than overflowing 2023-05-18 11:39:33 +01:00
cpregs.h target/arm/cpregs: Include missing 'kvm-consts.h' header 2024-01-26 11:30:48 +00:00
cpu64.c target/arm/kvm: Have kvm_arm_sve_get_vls take a ARMCPU argument 2023-12-19 17:57:45 +00:00
cpu-features.h target/arm: Fix incorrect aa64_tidcp1 feature check 2024-01-26 12:20:03 +00:00
cpu-param.h target/arm: Replace TARGET_PAGE_ENTRY_EXTRA 2023-10-03 08:01:02 -07:00
cpu-qom.h target/arm: Move ARM_CPU_IRQ/FIQ definitions to 'cpu-qom.h' header 2024-01-26 11:30:49 +00:00
cpu.c tests/tcg: Fix multiarch/gdbstub/prot-none.py 2024-02-03 13:31:45 +00:00
cpu.h include/exec: Implement cpu_mmu_index generically 2024-02-03 16:46:10 +10:00
debug_helper.c target/arm: Mark up VNCR offsets (offsets 0x100..0x160) 2024-01-09 14:44:45 +00:00
gdbstub64.c target/arm: Correct AArch64.S2MinTxSZ 32-bit EL1 input size check 2023-05-12 16:01:25 +01:00
gdbstub.c target/arm: Move feature test functions to their own header 2023-10-27 11:44:32 +01:00
gtimer.h target/arm: Move GTimer definitions to new 'gtimer.h' header 2024-01-26 11:30:49 +00:00
helper.c target/arm: Use new CBAR encoding for all v8 CPUs, not all aarch64 CPUs 2024-02-15 14:32:38 +00:00
helper.h target/arm: Implement FEAT_TIDCP1 2023-09-08 16:41:35 +01:00
hvf_arm.h hvf: add guest debugging handlers for Apple Silicon hosts 2023-06-06 10:19:30 +01:00
hyp_gdbstub.c arm: move KVM breakpoints helpers 2023-06-06 10:19:29 +01:00
idau.h Use DECLARE_*CHECKER* macros 2020-09-09 09:27:09 -04:00
internals.h target/arm: Adjust and validate mtedesc sizem1 2024-02-15 11:30:44 +00:00
Kconfig target/arm: Explain why we need to select ARM_V7M 2023-05-30 15:50:17 +01:00
kvm_arm.h target/arm/kvm: Have kvm_arm_pmu_set_irq take a ARMCPU argument 2023-12-19 17:57:46 +00:00
kvm-consts.h target/arm: Remove KVM AArch32 CPU definitions 2023-04-20 10:21:15 +01:00
kvm-stub.c target/arm: Avoid bare abort() or assert(0) 2022-05-05 09:35:51 +01:00
kvm.c target/arm: Move GTimer definitions to new 'gtimer.h' header 2024-01-26 11:30:49 +00:00
machine.c target/arm: Move GTimer definitions to new 'gtimer.h' header 2024-01-26 11:30:49 +00:00
meson.build meson: rename config_all 2023-12-31 09:11:28 +01:00
multiprocessing.h target/arm: Expose arm_cpu_mp_affinity() in 'multiprocessing.h' header 2024-01-26 11:30:48 +00:00
op_addsub.h
ptw.c target/arm: arm_pamax() no longer needs to do feature propagation 2024-01-15 17:12:22 +00:00
syndrome.h target/arm: fix exception syndrome for AArch32 bkpt insn 2024-02-02 13:51:57 +00:00
tcg-stubs.c target/arm: Move hflags code into the tcg directory 2023-02-27 13:27:04 +00:00
trace-events target/arm/helper: Implement CNTHCTL_EL2.CNT[VP]MASK 2023-08-22 17:31:13 +01:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
vfp_helper.c target/arm: Move feature test functions to their own header 2023-10-27 11:44:32 +01:00