[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 19/35] target/arm: Pass an ARMSecuritySpace to arm_is_el2_enabled_
From: |
Peter Maydell |
Subject: |
[PULL 19/35] target/arm: Pass an ARMSecuritySpace to arm_is_el2_enabled_secstate() |
Date: |
Thu, 24 Aug 2023 10:28:20 +0100 |
Pass an ARMSecuritySpace instead of a bool secure to
arm_is_el2_enabled_secstate(). This doesn't change behaviour.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20230807141514.19075-8-peter.maydell@linaro.org
---
target/arm/cpu.h | 13 ++++++++-----
target/arm/helper.c | 2 +-
2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/target/arm/cpu.h b/target/arm/cpu.h
index bcd65a63ca0..02bc8f0e8e0 100644
--- a/target/arm/cpu.h
+++ b/target/arm/cpu.h
@@ -2504,17 +2504,19 @@ static inline bool arm_is_secure(CPUARMState *env)
/*
* Return true if the current security state has AArch64 EL2 or AArch32 Hyp.
- * This corresponds to the pseudocode EL2Enabled()
+ * This corresponds to the pseudocode EL2Enabled().
*/
-static inline bool arm_is_el2_enabled_secstate(CPUARMState *env, bool secure)
+static inline bool arm_is_el2_enabled_secstate(CPUARMState *env,
+ ARMSecuritySpace space)
{
+ assert(space != ARMSS_Root);
return arm_feature(env, ARM_FEATURE_EL2)
- && (!secure || (env->cp15.scr_el3 & SCR_EEL2));
+ && (space != ARMSS_Secure || (env->cp15.scr_el3 & SCR_EEL2));
}
static inline bool arm_is_el2_enabled(CPUARMState *env)
{
- return arm_is_el2_enabled_secstate(env, arm_is_secure_below_el3(env));
+ return arm_is_el2_enabled_secstate(env, arm_security_space_below_el3(env));
}
#else
@@ -2538,7 +2540,8 @@ static inline bool arm_is_secure(CPUARMState *env)
return false;
}
-static inline bool arm_is_el2_enabled_secstate(CPUARMState *env, bool secure)
+static inline bool arm_is_el2_enabled_secstate(CPUARMState *env,
+ ARMSecuritySpace space)
{
return false;
}
diff --git a/target/arm/helper.c b/target/arm/helper.c
index 9862bc73b52..8290ca0aaad 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -5778,7 +5778,7 @@ uint64_t arm_hcr_el2_eff_secstate(CPUARMState *env,
ARMSecuritySpace space)
assert(space != ARMSS_Root);
- if (!arm_is_el2_enabled_secstate(env, arm_space_is_secure(space))) {
+ if (!arm_is_el2_enabled_secstate(env, space)) {
/*
* "This register has no effect if EL2 is not enabled in the
* current Security state". This is ARMv8.4-SecEL2 speak for
--
2.34.1
- [PULL 09/35] mips: Report an error when KVM_VM_MIPS_VZ is unavailable, (continued)
- [PULL 09/35] mips: Report an error when KVM_VM_MIPS_VZ is unavailable, Peter Maydell, 2023/08/24
- [PULL 16/35] target/arm/ptw: Pass ptw into get_phys_addr_pmsa*() and get_phys_addr_disabled(), Peter Maydell, 2023/08/24
- [PULL 11/35] accel/kvm: Free as when an error occurred, Peter Maydell, 2023/08/24
- [PULL 15/35] target/arm/ptw: Set s1ns bit in fault info more consistently, Peter Maydell, 2023/08/24
- [PULL 10/35] accel/kvm: Use negative KVM type for error propagation, Peter Maydell, 2023/08/24
- [PULL 32/35] target/arm/helper: Check SCR_EL3.{NSE, NS} encoding for AT instructions, Peter Maydell, 2023/08/24
- [PULL 35/35] target/arm: Fix 64-bit SSRA, Peter Maydell, 2023/08/24
- [PULL 30/35] target/arm: Skip granule protection checks for AT instructions, Peter Maydell, 2023/08/24
- [PULL 17/35] target/arm/ptw: Pass ARMSecurityState to regime_translation_disabled(), Peter Maydell, 2023/08/24
- [PULL 07/35] kvm: Introduce kvm_arch_get_default_type hook, Peter Maydell, 2023/08/24
- [PULL 19/35] target/arm: Pass an ARMSecuritySpace to arm_is_el2_enabled_secstate(),
Peter Maydell <=
- [PULL 25/35] target/arm/ptw: Check for block descriptors at invalid levels, Peter Maydell, 2023/08/24
- [PULL 26/35] target/arm/ptw: Report stage 2 fault level for stage 2 faults on stage 1 ptw, Peter Maydell, 2023/08/24
- [PULL 23/35] target/arm/ptw: Drop S1Translate::out_secure, Peter Maydell, 2023/08/24
- [PULL 22/35] target/arm/ptw: Remove S1Translate::in_secure, Peter Maydell, 2023/08/24
- [PULL 08/35] accel/kvm: Specify default IPA size for arm64, Peter Maydell, 2023/08/24
- [PULL 27/35] target/arm: Adjust PAR_EL1.SH for Device and Normal-NC memory types, Peter Maydell, 2023/08/24
- [PULL 31/35] target/arm: Pass security space rather than flag for AT instructions, Peter Maydell, 2023/08/24
- [PULL 12/35] accel/kvm: Make kvm_dirty_ring_reaper_init() void, Peter Maydell, 2023/08/24
- [PULL 34/35] target/arm: Fix SME ST1Q, Peter Maydell, 2023/08/24
- [PULL 33/35] target/arm/helper: Implement CNTHCTL_EL2.CNT[VP]MASK, Peter Maydell, 2023/08/24