diff options
| author | Alejandro Colomar <alx@kernel.org> | 2024-05-30 14:30:35 +0200 |
|---|---|---|
| committer | Alejandro Colomar <alx@kernel.org> | 2024-05-31 01:54:55 +0200 |
| commit | b3d46263b341fe6eab9201c61fc14dadea10ced0 (patch) | |
| tree | 2bcfa5fc9bbde8d91f60f03edc6fc10c4ad9da8e | |
| parent | b4ae2650c83d9e941621b6de468ea8a4e00dec45 (diff) | |
| download | man-pages-b3d46263b341fe6eab9201c61fc14dadea10ced0.tar.gz | |
prctl.2, PR_SVE_SET_VL.2const: Split PR_SVE_SET_VL from prctl(2)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
| -rw-r--r-- | man/man2/prctl.2 | 135 | ||||
| -rw-r--r-- | man/man2const/PR_SVE_SET_VL.2const | 166 |
2 files changed, 168 insertions, 133 deletions
diff --git a/man/man2/prctl.2 b/man/man2/prctl.2 index a2babf78ae..290a92e40d 100644 --- a/man/man2/prctl.2 +++ b/man/man2/prctl.2 @@ -127,129 +127,8 @@ The first argument can be: .B PR_GET_SPECULATION_CTRL .TQ .B PR_SET_SPECULATION_CTRL -.\" prctl PR_SVE_SET_VL -.\" commit 2d2123bc7c7f843aa9db87720de159a049839862 -.\" linux-5.6/Documentation/arm64/sve.rst -.TP -.BR PR_SVE_SET_VL " (since Linux 4.15, only on arm64)" -Configure the thread's SVE vector length, -as specified by -.IR "(int) arg2" . -Arguments -.IR arg3 , -.IR arg4 , -and -.I arg5 -are ignored. -.IP -The bits of -.I arg2 -corresponding to -.B PR_SVE_VL_LEN_MASK -must be set to the desired vector length in bytes. -This is interpreted as an upper bound: -the kernel will select the greatest available vector length -that does not exceed the value specified. -In particular, specifying -.B SVE_VL_MAX -(defined in -.I <asm/sigcontext.h>) -for the -.B PR_SVE_VL_LEN_MASK -bits requests the maximum supported vector length. -.IP -In addition, the other bits of -.I arg2 -must be set to one of the following combinations of flags: -.RS -.TP -.B 0 -Perform the change immediately. -At the next -.BR execve (2) -in the thread, -the vector length will be reset to the value configured in -.IR /proc/sys/abi/sve_default_vector_length . -.TP -.B PR_SVE_VL_INHERIT -Perform the change immediately. -Subsequent -.BR execve (2) -calls will preserve the new vector length. -.TP -.B PR_SVE_SET_VL_ONEXEC -Defer the change, so that it is performed at the next -.BR execve (2) -in the thread. -Further -.BR execve (2) -calls will reset the vector length to the value configured in -.IR /proc/sys/abi/sve_default_vector_length . -.TP -.B "PR_SVE_SET_VL_ONEXEC | PR_SVE_VL_INHERIT" -Defer the change, so that it is performed at the next -.BR execve (2) -in the thread. -Further -.BR execve (2) -calls will preserve the new vector length. -.RE -.IP -In all cases, -any previously pending deferred change is canceled. -.IP -The call fails with error -.B EINVAL -if SVE is not supported on the platform, if -.I arg2 -is unrecognized or invalid, or the value in the bits of -.I arg2 -corresponding to -.B PR_SVE_VL_LEN_MASK -is outside the range -.BR SVE_VL_MIN .. SVE_VL_MAX -or is not a multiple of 16. -.IP -On success, -a nonnegative value is returned that describes the -.I selected -configuration. -If -.B PR_SVE_SET_VL_ONEXEC -was included in -.IR arg2 , -then the configuration described by the return value -will take effect at the next -.BR execve (2). -Otherwise, the configuration is already in effect when the +.TQ .B PR_SVE_SET_VL -call returns. -In either case, the value is encoded in the same way as the return value of -.BR PR_SVE_GET_VL . -Note that there is no explicit flag in the return value -corresponding to -.BR PR_SVE_SET_VL_ONEXEC . -.IP -The configuration (including any pending deferred change) -is inherited across -.BR fork (2) -and -.BR clone (2). -.IP -For more information, see the kernel source file -.I Documentation/arm64/sve.rst -.\"commit b693d0b372afb39432e1c49ad7b3454855bc6bed -(or -.I Documentation/arm64/sve.txt -before Linux 5.3). -.IP -.B Warning: -Because the compiler or run-time environment -may be using SVE, using this call without the -.B PR_SVE_SET_VL_ONEXEC -flag may crash the calling process. -The conditions for using it safely are complex and system-dependent. -Don't use it unless you really know what you are doing. .\" prctl PR_SVE_GET_VL .TP .BR PR_SVE_GET_VL " (since Linux 4.15, only on arm64)" @@ -822,7 +701,6 @@ for information on the protection mask bits.) .SH RETURN VALUE On success, .BR PR_SVE_GET_VL , -.BR PR_SVE_SET_VL , .BR PR_GET_TAGGED_ADDR_CTRL , .BR PR_GET_THP_DISABLE , .BR PR_GET_TIMING , @@ -875,16 +753,6 @@ is not .B EINVAL .I op is -.B PR_SVE_SET_VL -and the arguments are invalid or unsupported, -or SVE is not available on this platform. -See the description of -.B PR_SVE_SET_VL -above for details. -.TP -.B EINVAL -.I op -is .B PR_SVE_GET_VL and SVE is not available on this platform. .TP @@ -985,4 +853,5 @@ glibc 2.0.6 .BR PR_GET_SECUREBITS (2const), .BR PR_SET_SPECULATION_CTRL (2const), .BR PR_GET_SPECULATION_CTRL (2const), +.BR PR_SVE_SET_VL (2const), .BR core (5) diff --git a/man/man2const/PR_SVE_SET_VL.2const b/man/man2const/PR_SVE_SET_VL.2const new file mode 100644 index 0000000000..b0b77f680a --- /dev/null +++ b/man/man2const/PR_SVE_SET_VL.2const @@ -0,0 +1,166 @@ +.\" Copyright 2020, Dave Martin <Dave.Martin@arm.com> +.\" Copyright 2020, Michael Kerrisk <mtk.manpages@gmail.com> +.\" +.\" SPDX-License-Identifier: Linux-man-pages-copyleft +.\" +.TH PR_SVE_SET_VL 2const (date) "Linux man-pages (unreleased)" +.SH NAME +PR_SVE_SET_VL +\- +set the thread's SVE vector length +.SH LIBRARY +Standard C library +.RI ( libc ", " \-lc ) +.SH SYNOPSIS +.nf +.B #include <sys/prctl.h> +.P +.BI "int prctl(int " op ", ...);" +.fi +.SH DESCRIPTION +.\" commit 2d2123bc7c7f843aa9db87720de159a049839862 +.\" linux-5.6/Documentation/arm64/sve.rst +.TP +.BR PR_SVE_SET_VL " (since Linux 4.15, only on arm64)" +Configure the thread's SVE vector length, +as specified by +.IR "(int) arg2" . +Arguments +.IR arg3 , +.IR arg4 , +and +.I arg5 +are ignored. +.IP +The bits of +.I arg2 +corresponding to +.B PR_SVE_VL_LEN_MASK +must be set to the desired vector length in bytes. +This is interpreted as an upper bound: +the kernel will select the greatest available vector length +that does not exceed the value specified. +In particular, specifying +.B SVE_VL_MAX +(defined in +.I <asm/sigcontext.h>) +for the +.B PR_SVE_VL_LEN_MASK +bits requests the maximum supported vector length. +.IP +In addition, the other bits of +.I arg2 +must be set to one of the following combinations of flags: +.RS +.TP +.B 0 +Perform the change immediately. +At the next +.BR execve (2) +in the thread, +the vector length will be reset to the value configured in +.IR /proc/sys/abi/sve_default_vector_length . +.TP +.B PR_SVE_VL_INHERIT +Perform the change immediately. +Subsequent +.BR execve (2) +calls will preserve the new vector length. +.TP +.B PR_SVE_SET_VL_ONEXEC +Defer the change, so that it is performed at the next +.BR execve (2) +in the thread. +Further +.BR execve (2) +calls will reset the vector length to the value configured in +.IR /proc/sys/abi/sve_default_vector_length . +.TP +.B "PR_SVE_SET_VL_ONEXEC | PR_SVE_VL_INHERIT" +Defer the change, so that it is performed at the next +.BR execve (2) +in the thread. +Further +.BR execve (2) +calls will preserve the new vector length. +.RE +.IP +In all cases, +any previously pending deferred change is canceled. +.IP +The call fails with error +.B EINVAL +if SVE is not supported on the platform, if +.I arg2 +is unrecognized or invalid, or the value in the bits of +.I arg2 +corresponding to +.B PR_SVE_VL_LEN_MASK +is outside the range +.BR SVE_VL_MIN .. SVE_VL_MAX +or is not a multiple of 16. +.IP +On success, +a nonnegative value is returned that describes the +.I selected +configuration. +If +.B PR_SVE_SET_VL_ONEXEC +was included in +.IR arg2 , +then the configuration described by the return value +will take effect at the next +.BR execve (2). +Otherwise, the configuration is already in effect when the +.B PR_SVE_SET_VL +call returns. +In either case, the value is encoded in the same way as the return value of +.BR PR_SVE_GET_VL . +Note that there is no explicit flag in the return value +corresponding to +.BR PR_SVE_SET_VL_ONEXEC . +.IP +The configuration (including any pending deferred change) +is inherited across +.BR fork (2) +and +.BR clone (2). +.IP +For more information, see the kernel source file +.I Documentation/arm64/sve.rst +.\"commit b693d0b372afb39432e1c49ad7b3454855bc6bed +(or +.I Documentation/arm64/sve.txt +before Linux 5.3). +.IP +.B Warning: +Because the compiler or run-time environment +may be using SVE, using this call without the +.B PR_SVE_SET_VL_ONEXEC +flag may crash the calling process. +The conditions for using it safely are complex and system-dependent. +Don't use it unless you really know what you are doing. +.SH RETURN VALUE +On success, +.BR PR_SVE_SET_VL , +return the nonnegative values described above. +On error, \-1 is returned, and +.I errno +is set to indicate the error. +.SH ERRORS +.TP +.B EINVAL +.I op +is +.B PR_SVE_SET_VL +and the arguments are invalid or unsupported, +or SVE is not available on this platform. +See the description of +.B PR_SVE_SET_VL +above for details. +.SH STANDARDS +Linux. +.SH HISTORY +.SH SEE ALSO +.BR prctl (2), +.BR PR_SVE_GET_VL (2const) |
