Skip to content

Commit 9442d05

Browse files
Marc Zyngierctmarinas
authored andcommitted
arm64/sme: Fix __finalise_el2 SMEver check
When checking for ID_AA64SMFR0_EL1.SMEver, __check_override assumes that the ID_AA64SMFR0_EL1 value is in x1, and the intent of the code is to reuse value read a few lines above. However, as the comment says at the beginning of the macro, x1 will be clobbered, and the checks always fails. The easiest fix is just to reload the id register before checking it. Fixes: f122576 ("arm64/sme: Enable host kernel to access ZT0") Signed-off-by: Marc Zyngier <[email protected]> Reviewed-by: Mark Brown <[email protected]> Signed-off-by: Catalin Marinas <[email protected]>
1 parent b2ab432 commit 9442d05

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

arch/arm64/kernel/hyp-stub.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ SYM_CODE_START_LOCAL(__finalise_el2)
133133
.Lskip_sme_fa64:
134134

135135
// ZT0 available?
136+
mrs_s x1, SYS_ID_AA64SMFR0_EL1
136137
__check_override id_aa64smfr0 ID_AA64SMFR0_EL1_SMEver_SHIFT 4 .Linit_sme_zt0 .Lskip_sme_zt0
137138
.Linit_sme_zt0:
138139
orr x0, x0, SMCR_ELx_EZT0_MASK

0 commit comments

Comments
 (0)