qemu/target/arm
Peter Maydell 2d12bb96bd target/arm/ptw: Pass an ARMSecuritySpace to arm_hcr_el2_eff_secstate()
arm_hcr_el2_eff_secstate() takes a bool secure, which it uses to
determine whether EL2 is enabled in the current security state.
With the advent of FEAT_RME this is no longer sufficient, because
EL2 can be enabled for Secure state but not for Root, and both
of those will pass 'secure == true' in the callsites in ptw.c.

As it happens in all of our callsites in ptw.c we either avoid making
the call or else avoid using the returned value if we're doing a
translation for Root, so this is not a behaviour change even if the
experimental FEAT_RME is enabled.  But it is less confusing in the
ptw.c code if we avoid the use of a bool secure that duplicates some
of the information in the ArmSecuritySpace argument.

Make arm_hcr_el2_eff_secstate() take an ARMSecuritySpace argument
instead. Because we always want to know the HCR_EL2 for the
security state defined by the current effective value of
SCR_EL3.{NSE,NS}, it makes no sense to pass ARMSS_Root here,
and we assert that callers don't do that.

To avoid the assert(), we thus push the call to
arm_hcr_el2_eff_secstate() down into the cases in
regime_translation_disabled() that need it, rather than calling the
function and ignoring the result for the Root space translations.
All other calls to this function in ptw.c are already in places
where we have confirmed that the mmu_idx is a stage 2 translation
or that the regime EL is not 3.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20230807141514.19075-7-peter.maydell@linaro.org
2023-08-22 17:31:07 +01:00
..
hvf accel: Rename HVF 'struct hvf_vcpu_state' -> AccelCPUState 2023-06-28 14:14:22 +02:00
tcg target/arm/tcg: Don't build AArch64 decodetree files for qemu-system-arm 2023-07-31 11:41:21 +01:00
arch_dump.c dump: Replace opaque DumpState pointer with a typed one 2022-10-06 19:30:43 +04:00
arm-powerctl.c target/arm: Wrap arm_rebuild_hflags calls with tcg_enabled 2023-02-27 13:27:04 +00:00
arm-powerctl.h
arm-qmp-cmds.c target/arm: Restrict 'qapi-commands-machine.h' to system emulation 2023-03-02 07:51:06 +01:00
common-semi-target.h semihosting: Split out common-semi-target.h 2022-06-28 04:35:07 +05:30
cortex-regs.c target/arm: Saturate L2CTLR_EL1 core count field rather than overflowing 2023-05-18 11:39:33 +01:00
cpregs.h accel/tcg: Introduce translator_io_start 2023-06-05 12:04:29 -07:00
cpu64.c arm: spelling fixes 2023-07-25 17:13:53 +03:00
cpu-param.h target/arm: Remove NB_MMU_MODES define 2023-03-13 06:44:37 -07:00
cpu-qom.h target/arm: Convert to 3-phase reset 2022-12-16 15:58:15 +00:00
cpu.c arm: spelling fixes 2023-07-25 17:13:53 +03:00
cpu.h target/arm/ptw: Pass an ARMSecuritySpace to arm_hcr_el2_eff_secstate() 2023-08-22 17:31:07 +01:00
debug_helper.c target/arm: Special case M-profile in debug_helper.c code 2023-07-25 10:56:51 +01: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: gdbstub: Guard M-profile code with CONFIG_TCG 2023-07-06 13:26:43 +01:00
helper.c target/arm/ptw: Pass an ARMSecuritySpace to arm_hcr_el2_eff_secstate() 2023-08-22 17:31:07 +01:00
helper.h target/arm: Demultiplex AESE and AESMC 2023-07-08 07:30:18 +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: Implement GPC exceptions 2023-06-23 11:15:48 +01:00
Kconfig target/arm: Explain why we need to select ARM_V7M 2023-05-30 15:50:17 +01:00
kvm64.c arm: move KVM breakpoints helpers 2023-06-06 10:19:29 +01:00
kvm_arm.h hw/intc/arm_gic: Un-inline GIC*/ITS class_name() helpers 2023-06-28 14:27:59 +02: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 accel/kvm: Specify default IPA size for arm64 2023-08-22 17:31:02 +01:00
machine.c target/arm: Wrap arm_rebuild_hflags calls with tcg_enabled 2023-02-27 13:27:04 +00:00
meson.build meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
op_addsub.h
ptw.c target/arm/ptw: Pass an ARMSecuritySpace to arm_hcr_el2_eff_secstate() 2023-08-22 17:31:07 +01:00
syndrome.h target/arm: Add GPC syndrome 2023-06-23 11:15:47 +01:00
tcg-stubs.c target/arm: Move hflags code into the tcg directory 2023-02-27 13:27:04 +00:00
trace-events docs: fix references to docs/devel/tracing.rst 2021-06-02 06:51:09 +02: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: Use float64_to_int32_modulo for FJCVTZS 2023-07-01 08:26:54 +02:00