2d12bb96bd
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 |
||
---|---|---|
.. | ||
hvf | ||
tcg | ||
arch_dump.c | ||
arm-powerctl.c | ||
arm-powerctl.h | ||
arm-qmp-cmds.c | ||
common-semi-target.h | ||
cortex-regs.c | ||
cpregs.h | ||
cpu64.c | ||
cpu-param.h | ||
cpu-qom.h | ||
cpu.c | ||
cpu.h | ||
debug_helper.c | ||
gdbstub64.c | ||
gdbstub.c | ||
helper.c | ||
helper.h | ||
hvf_arm.h | ||
hyp_gdbstub.c | ||
idau.h | ||
internals.h | ||
Kconfig | ||
kvm64.c | ||
kvm_arm.h | ||
kvm-consts.h | ||
kvm-stub.c | ||
kvm.c | ||
machine.c | ||
meson.build | ||
op_addsub.h | ||
ptw.c | ||
syndrome.h | ||
tcg-stubs.c | ||
trace-events | ||
trace.h | ||
vfp_helper.c |