aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@kernel.org>2024-05-30 13:45:41 +0200
committerAlejandro Colomar <alx@kernel.org>2024-05-31 01:54:54 +0200
commit9bc2a444621ce29d317d98aabcdcd1913bf6b9e7 (patch)
tree3f68cedbeceb61f33048ff62a2d54b40b45fb00a
parentd2fc605bac92f6154fd77c6b1734b61b87c55f25 (diff)
downloadman-pages-9bc2a444621ce29d317d98aabcdcd1913bf6b9e7.tar.gz
PR_SET_SPECULATION_CTRL.2const: Tweak after split
Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rw-r--r--man/man2const/PR_SET_SPECULATION_CTRL.2const87
1 files changed, 19 insertions, 68 deletions
diff --git a/man/man2const/PR_SET_SPECULATION_CTRL.2const b/man/man2const/PR_SET_SPECULATION_CTRL.2const
index 271299d610..e2b02a7df7 100644
--- a/man/man2const/PR_SET_SPECULATION_CTRL.2const
+++ b/man/man2const/PR_SET_SPECULATION_CTRL.2const
@@ -1,5 +1,6 @@
.\" Copyright 2018, Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
.\" Copyright 2018, Michael Kerrisk <mtk.manpages@gmail.com>
+.\" Copyright 2024, Alejandro Colomar <alx@kernel.org>
.\"
.\" SPDX-License-Identifier: Linux-man-pages-copyleft
.\"
@@ -15,21 +16,16 @@ Standard C library
.nf
.B #include <sys/prctl.h>
.P
-.BI "int prctl(int " op ", ...);"
+.BI "int prctl(PR_SET_SPECULATION_CTRL, long " misfeature ", long " val ", 0L, 0L);"
.fi
.SH DESCRIPTION
-.TP
-.BR PR_SET_SPECULATION_CTRL " (since Linux 4.17)"
-.\" commit b617cfc858161140d69cc0b5cc211996b557a1c7
-.\" commit 356e4bfff2c5489e016fdb925adbf12a1e3950ee
Sets the state of the speculation misfeature specified in
-.IR arg2 .
+.IR misfeature .
The speculation-misfeature settings are per-thread attributes.
-.IP
+.P
Currently,
-.I arg2
+.I misfeature
must be one of:
-.RS
.TP
.B PR_SPEC_STORE_BYPASS
Set the state of the speculative store bypass misfeature.
@@ -37,19 +33,11 @@ Set the state of the speculative store bypass misfeature.
.TP
.BR PR_SPEC_INDIRECT_BRANCH " (since Linux 4.20)"
Set the state of the indirect branch speculation misfeature.
-.RE
-.IP
-If
-.I arg2
-does not have one of the above values,
-then the call fails with the error
-.BR ENODEV .
-.IP
+.P
The
-.I arg3
+.I val
argument is used to hand in the control value,
which is one of the following:
-.RS
.TP
.B PR_SPEC_ENABLE
The speculation feature is enabled, mitigation is disabled.
@@ -61,14 +49,6 @@ The speculation feature is disabled, mitigation is enabled.
Same as
.BR PR_SPEC_DISABLE ,
but cannot be undone.
-A subsequent
-.BR prctl (\c
-.IR arg2 ,
-.BR PR_SPEC_ENABLE )
-with the same value for
-.I arg2
-will fail with the error
-.BR EPERM .
.\" commit 71368af9027f18fe5d1c6f372cfdff7e4bde8b48
.TP
.BR PR_SPEC_DISABLE_NOEXEC " (since Linux 5.1)"
@@ -77,23 +57,8 @@ Same as
but the state will be cleared on
.BR execve (2).
Currently only supported for
-.I arg2
-equal to
-.B PR_SPEC_STORE_BYPASS.
-.RE
-.IP
-Any unsupported value in
-.I arg3
-will result in the call failing with the error
-.BR ERANGE .
-.IP
-The
-.I arg4
-and
-.I arg5
-arguments must be specified as 0; otherwise the call fails with the error
-.BR EINVAL .
-.IP
+.BR PR_SPEC_STORE_BYPASS .
+.P
The speculation feature can also be controlled by the
.B spec_store_bypass_disable
boot parameter.
@@ -102,7 +67,7 @@ This parameter may enforce a read-only policy which will result in the
call failing with the error
.BR ENXIO .
For further details, see the kernel source file
-.IR Documentation/admin\-guide/kernel\-parameters.txt .
+.IR Documentation/\:admin\-guide/\:kernel\-parameters.txt .
.SH RETURN VALUE
On success,
0 is returned.
@@ -112,43 +77,29 @@ is set to indicate the error.
.SH ERRORS
.TP
.B ENODEV
-.I op
-was
-.B PR_SET_SPECULATION_CTRL
-the kernel or CPU does not support the requested speculation misfeature.
+The kernel or CPU does not support the requested speculation
+.IR misfeature .
.TP
.B ENXIO
-.I op
-was
-.B PR_SET_SPECULATION_CTRL
-implies that the control of the selected speculation misfeature is not possible.
+The control of the selected speculation misfeature is not possible.
See
.B PR_GET_SPECULATION_CTRL
for the bit fields to determine which option is available.
.TP
.B EPERM
-.I op
-is
-.B PR_SET_SPECULATION_CTRL
-wherein the speculation was disabled with
+The speculation was disabled with
.B PR_SPEC_FORCE_DISABLE
and caller tried to enable it again.
.TP
.B ERANGE
-.I op
-was
-.B PR_SET_SPECULATION_CTRL
-and
-.I arg3
-is not
-.BR PR_SPEC_ENABLE ,
-.BR PR_SPEC_DISABLE ,
-.BR PR_SPEC_FORCE_DISABLE ,
-nor
-.BR PR_SPEC_DISABLE_NOEXEC .
+.I misfeature
+is not a valid value.
.SH STANDARDS
Linux.
.SH HISTORY
+Linux 4.17.
+.\" commit b617cfc858161140d69cc0b5cc211996b557a1c7
+.\" commit 356e4bfff2c5489e016fdb925adbf12a1e3950ee
.SH SEE ALSO
.BR prctl (2),
.BR PR_GET_SPECULATION_CTRL (2const)