Skip to contentSkip to conversation

arm64/fp: Add comments documenting the usage of state restore functions

PATCH Applied Mark Brown 2 participants 2 messages Dec 7, 2021 – Dec 14, 2021 arm64

lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 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.

---
 arch/arm64/kernel/fpsimd.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
arch/arm64/kernel/fpsimd.c +5 -2
index 6fb361e8bed8..d3573f19e831 100644
@@ -1217,7 +1217,8 @@ void fpsimd_bind_state_to_cpu(struct user_fpsimd_state *st, void *sve_state,
 /*
  * Load the userland FPSIMD state of 'current' from memory, but only if the
  * FPSIMD state already held in the registers is /not/ the most recent FPSIMD
- * state of 'current'
+ * state of 'current'.  This is called when we are preparing to return to
+ * userspace to ensure that userspace sees a good register state.
  */
 void fpsimd_restore_current_state(void)
 {
@@ -1248,7 +1249,9 @@ void fpsimd_restore_current_state(void)
 /*
  * Load an updated userland FPSIMD state for 'current' from memory and set the
  * flag that indicates that the FPSIMD register contents are the most recent
- * FPSIMD state of 'current'
+ * FPSIMD state of 'current'. This is used by the signal code to restore the
+ * register state when returning from a signal handler in FPSIMD only cases,
+ * any SVE context will be discarded.
  */
 void fpsimd_update_current_state(struct user_fpsimd_state const *state)
 {
Signature · 7 lines
2.30.2


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
maintainer Applied
#1 lore raw
Quoted 4 lines · Mark Brown

Add comments to help people figure out when fpsimd_bind_state_to_cpu() and fpsimd_update_current_state() are used.

Applied to arm64 (for-next/misc), thanks!

[1/1] arm64/fp: Add comments documenting the usage of state restore functions

      https://git.kernel.org/arm64/c/12b792e5e234
Signature · 7 lines
Catalin


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel