* [PATCH] arm64/fp: Add comments documenting the usage of state restore functions
@ 2021-12-07 16:32 Mark Brown
2021-12-14 19:17 ` Catalin Marinas
0 siblings, 1 reply; 2+ messages in thread
From: Mark Brown @ 2021-12-07 16:32 UTC (permalink / raw)
To: Catalin Marinas, Will Deacon; +Cc: linux-arm-kernel, Mark Brown
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 <broonie@kernel.org>
---
arch/arm64/kernel/fpsimd.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c
index 6fb361e8bed8..d3573f19e831 100644
--- a/arch/arm64/kernel/fpsimd.c
+++ b/arch/arm64/kernel/fpsimd.c
@@ -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)
{
--
2.30.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] arm64/fp: Add comments documenting the usage of state restore functions
2021-12-07 16:32 [PATCH] arm64/fp: Add comments documenting the usage of state restore functions Mark Brown
@ 2021-12-14 19:17 ` Catalin Marinas
0 siblings, 0 replies; 2+ messages in thread
From: Catalin Marinas @ 2021-12-14 19:17 UTC (permalink / raw)
To: Mark Brown, Will Deacon; +Cc: linux-arm-kernel
On Tue, 7 Dec 2021 16:32:50 +0000, Mark Brown wrote:
> 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
--
Catalin
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-12-14 19:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-07 16:32 [PATCH] arm64/fp: Add comments documenting the usage of state restore functions Mark Brown
2021-12-14 19:17 ` Catalin Marinas
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.