arm64/fpsimd: SME no longer requires SVE register state
authorMark Brown <broonie@kernel.org>
Tue, 15 Nov 2022 09:46:38 +0000 (09:46 +0000)
committerWill Deacon <will@kernel.org>
Tue, 29 Nov 2022 15:01:56 +0000 (15:01 +0000)
Now that we track the type of the stored register state separately to
what is active in the task, it is valid to have the FPSIMD register
state stored while in streaming mode. Remove the special case handling
for SME when setting FPSIMD register state.

Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Reviewed-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20221115094640.112848-7-broonie@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/kernel/fpsimd.c
arch/arm64/kernel/ptrace.c

index eb42b00dce54ee3d466e31f754367b119c24a909..7cb2d89ead83b9aa1ac8eb5334223aa95f329526 100644 (file)
@@ -815,8 +815,7 @@ void fpsimd_sync_to_sve(struct task_struct *task)
  */
 void sve_sync_to_fpsimd(struct task_struct *task)
 {
-       if (test_tsk_thread_flag(task, TIF_SVE) ||
-           thread_sm_enabled(&task->thread))
+       if (task->thread.fp_type == FP_STATE_SVE)
                sve_to_fpsimd(task);
 }
 
index 8a7c91791c162e27014407317db8902384401835..979dbdc36d52b1ae97abca8ce1ae916a76d6dac5 100644 (file)
@@ -907,8 +907,6 @@ static int sve_set_common(struct task_struct *target,
                ret = __fpr_set(target, regset, pos, count, kbuf, ubuf,
                                SVE_PT_FPSIMD_OFFSET);
                clear_tsk_thread_flag(target, TIF_SVE);
-               if (type == ARM64_VEC_SME)
-                       fpsimd_force_sync_to_sve(target);
                target->thread.fp_type = FP_STATE_FPSIMD;
                goto out;
        }