[PATCH 12/27] arm64/sve: Support vector length resetting for new processes

From
Dave Martin <Dave.Martin@arm.com>
Date
2017-08-22 17:22:24
Also in
kvmarm, linux-arch
Reply to
Alex Bennée, 2017-08-22
On Tue, Aug 22, 2017 at 05:22:11PM +0100, Alex Benn?e wrote:
Dave Martin [off-list ref] writes:
quoted
It's desirable to be able to reset the vector length to some sane
default for new processes, since the new binary and its libraries
processes may or may not be SVE-aware.

This patch tracks the desired post-exec vector length (if any) in a
new thread member sve_vl_onexec, and adds a new thread flag
TIF_SVE_VL_INHERIT to control whether to inherit or reset the
vector length.  Currently these are inactive.  Subsequent patches
will provide the capability to configure them.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
---
 arch/arm64/include/asm/processor.h   |  1 +
 arch/arm64/include/asm/thread_info.h |  1 +
 arch/arm64/kernel/fpsimd.c           | 13 +++++++++++++
 3 files changed, 15 insertions(+)
diff --git a/arch/arm64/include/asm/processor.h b/arch/arm64/include/asm/processor.h
index 969feed..da8802a 100644
--- a/arch/arm64/include/asm/processor.h
+++ b/arch/arm64/include/asm/processor.h
@@ -87,6 +87,7 @@ struct thread_struct {
 	struct fpsimd_state	fpsimd_state;
 	void			*sve_state;	/* SVE registers, if any */
 	u16			sve_vl;		/* SVE vector length */
+	u16			sve_vl_onexec;	/* SVE vl after next
exec */
Inconsistent size usage here as well...
Agreed, the same history applies as for sve_vl.  I'll replace this with
an unsigned int.

[...]

Cheers
---Dave
Thread (86 messages) 86 messages, 5 authors, last reply 2017-08-23
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help