diff options
author | Rémi Denis-Courmont | 2021-01-12 11:44:55 +0100 |
---|---|---|
committer | Peter Maydell | 2021-01-19 15:38:51 +0100 |
commit | e6ef0169264b00cce552404f689ce137018ff290 (patch) | |
tree | 5025f191d54239ffe6e4353dfa23b2aebcc259e3 /target/arm/cpu.h | |
parent | target/arm: add arm_is_el2_enabled() helper (diff) | |
download | qemu-e6ef0169264b00cce552404f689ce137018ff290.tar.gz qemu-e6ef0169264b00cce552404f689ce137018ff290.tar.xz qemu-e6ef0169264b00cce552404f689ce137018ff290.zip |
target/arm: use arm_is_el2_enabled() where applicable
Do not assume that EL2 is available in and only in non-secure context.
That equivalence is broken by ARMv8.4-SEL2.
Signed-off-by: Rémi Denis-Courmont <remi.denis.courmont@huawei.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20210112104511.36576-3-remi.denis.courmont@huawei.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'target/arm/cpu.h')
-rw-r--r-- | target/arm/cpu.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 0bdda90914..66e3603294 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -2210,7 +2210,7 @@ static inline bool arm_el_is_aa64(CPUARMState *env, int el) return aa64; } - if (arm_feature(env, ARM_FEATURE_EL2) && !arm_is_secure_below_el3(env)) { + if (arm_is_el2_enabled(env)) { aa64 = aa64 && (env->cp15.hcr_el2 & HCR_RW); } @@ -3154,7 +3154,7 @@ static inline int arm_debug_target_el(CPUARMState *env) bool secure = arm_is_secure(env); bool route_to_el2 = false; - if (arm_feature(env, ARM_FEATURE_EL2) && !secure) { + if (arm_is_el2_enabled(env)) { route_to_el2 = env->cp15.hcr_el2 & HCR_TGE || env->cp15.mdcr_el2 & MDCR_TDE; } |