Skip to content

Commit 14609c9

Browse files
refactor(target/arm): avoid sec space calculation while checking for el2 enablement when el2 feature's unset
1 parent a5a9f34 commit 14609c9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

target/arm/cpu.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2662,7 +2662,8 @@ static inline bool arm_is_el2_enabled_secstate(CPUARMState *env,
26622662

26632663
static inline bool arm_is_el2_enabled(CPUARMState *env)
26642664
{
2665-
return arm_is_el2_enabled_secstate(env, arm_security_space_below_el3(env));
2665+
return arm_feature(env, ARM_FEATURE_EL2)
2666+
&& arm_is_el2_enabled_secstate(env, arm_security_space_below_el3(env));
26662667
}
26672668

26682669
#else

0 commit comments

Comments
 (0)