From: Mark Brown Date: Fri, 9 Jun 2023 22:43:41 +0000 (+0100) Subject: arm64/fpsimd: Exit streaming mode when flushing tasks X-Git-Tag: v6.6.7~2467^2~2^6~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=af3215fd02308c9aa982a028284d6414eeb60c04;p=platform%2Fkernel%2Flinux-starfive.git arm64/fpsimd: Exit streaming mode when flushing tasks Ensure there is no path where we might attempt to save SME state after we flush a task by updating the SVCR register state as well as updating our in memory state. I haven't seen a specific case where this is happening or seen a path where it might happen but for the cost of a single low overhead instruction it seems sensible to close the potential gap. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20230607-arm64-flush-svcr-v2-1-827306001841@kernel.org Signed-off-by: Catalin Marinas --- diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c index 2fbafa5..7a1aeb9 100644 --- a/arch/arm64/kernel/fpsimd.c +++ b/arch/arm64/kernel/fpsimd.c @@ -1649,6 +1649,7 @@ 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;