]> Git Repo - linux.git/commitdiff
arm64/fpsimd: Don't flush SME register hardware state along with thread
authorMark Brown <[email protected]>
Mon, 24 Jul 2023 13:09:19 +0000 (14:09 +0100)
committerCatalin Marinas <[email protected]>
Wed, 26 Jul 2023 17:25:09 +0000 (18:25 +0100)
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: af3215fd0230 ("arm64/fpsimd: Exit streaming mode when flushing tasks")
Signed-off-by: Mark Brown <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Catalin Marinas <[email protected]>
arch/arm64/kernel/fpsimd.c

index 89d54a5242d16c4497244bbb096df72367cf9573..9d7d10d60bfdc7397d25a0ffea03464857c86355 100644 (file)
@@ -1666,7 +1666,6 @@ void fpsimd_flush_thread(void)
 
                fpsimd_flush_thread_vl(ARM64_VEC_SME);
                current->thread.svcr = 0;
-               sme_smstop();
        }
 
        current->thread.fp_type = FP_STATE_FPSIMD;
This page took 0.048916 seconds and 4 git commands to generate.