Skip to content

Commit 714f3cb

Browse files
brooniewilldeacon
authored andcommitted
arm64/sme: Don't flush SVE register state when handling SME traps
Currently as part of handling a SME access trap we flush the SVE register state. This is not needed and would corrupt register state if the task has access to the SVE registers already. For non-streaming mode accesses the required flushing will be done in the SVE access trap. For streaming mode SVE register accesses the architecture guarantees that the register state will be flushed when streaming mode is entered or exited so there is no need for us to do so. Simply remove the register initialisation. Fixes: 8bd7f91 ("arm64/sme: Implement traps and syscall handling for SME") Signed-off-by: Mark Brown <[email protected]> Reviewed-by: Catalin Marinas <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent 826a4fd commit 714f3cb

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

arch/arm64/kernel/fpsimd.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1462,17 +1462,6 @@ void do_sme_acc(unsigned long esr, struct pt_regs *regs)
14621462
fpsimd_bind_task_to_cpu();
14631463
}
14641464

1465-
/*
1466-
* If SVE was not already active initialise the SVE registers,
1467-
* any non-shared state between the streaming and regular SVE
1468-
* registers is architecturally guaranteed to be zeroed when
1469-
* we enter streaming mode. We do not need to initialize ZA
1470-
* since ZA must be disabled at this point and enabling ZA is
1471-
* architecturally defined to zero ZA.
1472-
*/
1473-
if (system_supports_sve() && !test_thread_flag(TIF_SVE))
1474-
sve_init_regs();
1475-
14761465
put_cpu_fpsimd_context();
14771466
}
14781467

0 commit comments

Comments
 (0)