Skip to content

Commit 3421ddb

Browse files
brooniectmarinas
authored andcommitted
arm64/fpsimd: Don't flush SME register hardware state along with thread
We recently changed the fpsimd thread flush to flush the physical SME state as well as the thread state for the current thread. Unfortunately this leads to intermittent corruption in interaction with the lazy FPSIMD register switching. When under heavy load such as can be triggered by the startup phase of fp-stress it is possible that the current thread may not be scheduled prior to returning to userspace, and indeed we may end up returning to the last thread that was scheduled on the PE without ever exiting the kernel to any other task. If that happens then we will not reload the register state from memory, leading to loss of any SME register state. Since this was purely an attempt to defensively close off potential problems revert the change. Fixes: af3215f ("arm64/fpsimd: Exit streaming mode when flushing tasks") Signed-off-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20230724-arm64-dont-flush-smstate-v1-1-9a8b637ace6c@kernel.org Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
1 parent d4d5be9 commit 3421ddb

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

arch/arm64/kernel/fpsimd.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1666,7 +1666,6 @@ void fpsimd_flush_thread(void)
16661666

16671667
fpsimd_flush_thread_vl(ARM64_VEC_SME);
16681668
current->thread.svcr = 0;
1669-
sme_smstop();
16701669
}
16711670

16721671
current->thread.fp_type = FP_STATE_FPSIMD;

0 commit comments

Comments
 (0)