[PATCH] arm64/sme: Fix the ffr variable assignment

Catalin Marinas catalin.marinas at arm.com
Wed Jun 1 10:13:46 PDT 2022


This variable is a bool and expected to be set to true if the FFR
state needs saving/restoring, false otherwise. In __efi_fpsimd_end()
this variable should be restored to the value of efi_sm_state but this
is a per-CPU variable, not to be read directly. Make ffr false if
!__this_cpu_read(efi_sm_state), leave it true otherwise.

Signed-off-by: Catalin Marinas <catalin.marinas at arm.com>
Fixes: e0838f6373e5 ("arm64/sme: Save and restore streaming mode over EFI runtime calls")
Reported-by: kernel test robot <lkp at intel.com>
Cc: Mark Brown <broonie at kernel.org>
---
 arch/arm64/kernel/fpsimd.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c
index 819979398127..8bc9080adab2 100644
--- a/arch/arm64/kernel/fpsimd.c
+++ b/arch/arm64/kernel/fpsimd.c
@@ -1960,13 +1960,12 @@ void __efi_fpsimd_end(void)
 			 * streaming mode.
 			 */
 			if (system_supports_sme()) {
-				if (__this_cpu_read(efi_sm_state)) {
+				if (__this_cpu_read(efi_sm_state))
 					sysreg_clear_set_s(SYS_SVCR,
 							   0,
 							   SVCR_SM_MASK);
-					if (!system_supports_fa64())
-						ffr = efi_sm_state;
-				}
+				else
+					ffr = false;
 			}
 
 			sve_load_state(sve_state + sve_ffr_offset(sve_max_vl()),

base-commit: 0616ea3f1b93a99264d84f3d002ae117f6526b62



More information about the linux-arm-kernel mailing list