Skip to content

Commit

Permalink
arm64/fpsimd: Exit streaming mode when flushing tasks
Browse files Browse the repository at this point in the history
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 <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230607-arm64-flush-svcr-v2-1-827306001841@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
  • Loading branch information
Mark Brown authored and Catalin Marinas committed Jun 16, 2023
1 parent ab9b400 commit af3215f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions arch/arm64/kernel/fpsimd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit af3215f

Please sign in to comment.