Skip to content

Commit 69af56a

Browse files
brooniectmarinas
authored andcommitted
arm64/fpsimd: Sync and zero pad FPSIMD state for streaming SVE
We have a function sve_sync_from_fpsimd_zeropad() which is used by the ptrace code to update the SVE state when the user writes to the the FPSIMD register set. Currently this checks that the task has SVE enabled but this will miss updates for tasks which have streaming SVE enabled if SVE has not been enabled for the thread, also do the conversion if the task has streaming SVE enabled. Fixes: e12310a ("arm64/sme: Implement ptrace support for streaming mode SVE registers") Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20230803-arm64-fix-ptrace-ssve-no-sve-v1-3-49df214bfb3e@kernel.org Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
1 parent 507ea5d commit 69af56a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/arm64/kernel/fpsimd.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,8 @@ void sve_sync_from_fpsimd_zeropad(struct task_struct *task)
835835
void *sst = task->thread.sve_state;
836836
struct user_fpsimd_state const *fst = &task->thread.uw.fpsimd_state;
837837

838-
if (!test_tsk_thread_flag(task, TIF_SVE))
838+
if (!test_tsk_thread_flag(task, TIF_SVE) &&
839+
!thread_sm_enabled(&task->thread))
839840
return;
840841

841842
vq = sve_vq_from_vl(thread_get_cur_vl(&task->thread));

0 commit comments

Comments
 (0)