Skip to content

Commit 12b792e

Browse files
brooniectmarinas
authored andcommitted
arm64/fp: Add comments documenting the usage of state restore functions
Add comments to help people figure out when fpsimd_bind_state_to_cpu() and fpsimd_update_current_state() are used. Signed-off-by: Mark Brown <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent 386a746 commit 12b792e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

arch/arm64/kernel/fpsimd.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,7 +1213,8 @@ void fpsimd_bind_state_to_cpu(struct user_fpsimd_state *st, void *sve_state,
12131213
/*
12141214
* Load the userland FPSIMD state of 'current' from memory, but only if the
12151215
* FPSIMD state already held in the registers is /not/ the most recent FPSIMD
1216-
* state of 'current'
1216+
* state of 'current'. This is called when we are preparing to return to
1217+
* userspace to ensure that userspace sees a good register state.
12171218
*/
12181219
void fpsimd_restore_current_state(void)
12191220
{
@@ -1244,7 +1245,9 @@ void fpsimd_restore_current_state(void)
12441245
/*
12451246
* Load an updated userland FPSIMD state for 'current' from memory and set the
12461247
* flag that indicates that the FPSIMD register contents are the most recent
1247-
* FPSIMD state of 'current'
1248+
* FPSIMD state of 'current'. This is used by the signal code to restore the
1249+
* register state when returning from a signal handler in FPSIMD only cases,
1250+
* any SVE context will be discarded.
12481251
*/
12491252
void fpsimd_update_current_state(struct user_fpsimd_state const *state)
12501253
{

0 commit comments

Comments
 (0)