arm64/ptrace: Flush FP state when setting ZT0
authorMark Brown <broonie@kernel.org>
Thu, 3 Aug 2023 00:19:06 +0000 (01:19 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Thu, 3 Aug 2023 14:42:14 +0000 (15:42 +0100)
commit89a65c3f170e5c3b05a626046c68354e2afd7912
tree9e0469493205370c9a3b86284f464669069d6232
parentc9bb40b7f786662e33d71afe236442b0b61f0446
arm64/ptrace: Flush FP state when setting ZT0

When setting ZT0 via ptrace we do not currently force a reload of the
floating point register state from memory, do that to ensure that the newly
set value gets loaded into the registers on next task execution.

The function was templated off the function for FPSIMD which due to our
providing the option of embedding a FPSIMD regset within the SVE regset
does not directly include the flush.

Fixes: f90b529bcbe5 ("arm64/sme: Implement ZT0 ptrace support")
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20230803-arm64-fix-ptrace-zt0-flush-v1-1-72e854eaf96e@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/kernel/ptrace.c