From: Alejandro Colomar Date: Thu, 30 May 2024 12:12:36 +0000 (+0200) Subject: PR_GET_SPECULATION_CTRL.2const: Tweak after split X-Git-Tag: man-pages-6.9~19^2~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b4ae2650c83d9e941621b6de468ea8a4e00dec45;p=thirdparty%2Fman-pages.git PR_GET_SPECULATION_CTRL.2const: Tweak after split Signed-off-by: Alejandro Colomar --- diff --git a/man/man2const/PR_GET_SPECULATION_CTRL.2const b/man/man2const/PR_GET_SPECULATION_CTRL.2const index cc547f17a..b86d7f753 100644 --- a/man/man2const/PR_GET_SPECULATION_CTRL.2const +++ b/man/man2const/PR_GET_SPECULATION_CTRL.2const @@ -1,5 +1,6 @@ .\" Copyright 2018, Konrad Rzeszutek Wilk .\" Copyright 2018, Michael Kerrisk +.\" Copyright 2024, Alejandro Colomar .\" .\" SPDX-License-Identifier: Linux-man-pages-copyleft .\" @@ -15,21 +16,25 @@ Standard C library .nf .B #include .P -.BI "int prctl(int " op ", ...);" +.BI "int prctl(PR_GET_SPECULATION_CTRL, long " misfeature ", 0L, 0L, 0L);" .fi .SH DESCRIPTION -.TP -.BR PR_GET_SPECULATION_CTRL " (since Linux 4.17)" -Return (as the function result) +Return the state of the speculation misfeature specified in -.IR arg2 . -Currently, the only permitted value for this argument is +.IR misfeature . +.P +Currently, +.I misfeature +must be one of: +.TP .B PR_SPEC_STORE_BYPASS -(otherwise the call fails with the error -.BR ENODEV ). -.IP -The return value uses bits 0-3 with the following meaning: -.RS +Get the state of the speculative store bypass misfeature. +.\" commit 9137bb27e60e554dab694eafa4cca241fa3a694f +.TP +.BR PR_SPEC_INDIRECT_BRANCH " (since Linux 4.20)" +Get the state of the indirect branch speculation misfeature. +.P +The return value uses bits 0-4 with the following meaning: .TP .B PR_SPEC_PRCTL Mitigation can be controlled per thread by @@ -51,36 +56,32 @@ Same as .BR PR_SPEC_DISABLE , but the state will be cleared on .BR execve (2). -.RE -.IP +.P If all bits are 0, then the CPU is not affected by the speculation misfeature. -.IP +.P If .B PR_SPEC_PRCTL is set, then per-thread control of the mitigation is available. If not set, -.BR prctl () +.BR PR_SET_SPECULATION_CTRL (2const) for the speculation misfeature will fail. -.IP -The -.IR arg3 , -.IR arg4 , -and -.I arg5 -arguments must be specified as 0; otherwise the call fails with the error -.BR EINVAL . .SH RETURN VALUE On success, -.BR PR_GET_SPECULATION_CTRL , -return the nonnegative values described above. +.B PR_GET_SPECULATION_CTRL +returns the nonnegative value described above. On error, \-1 is returned, and .I errno is set to indicate the error. .SH ERRORS +.TP +.B ENODEV +The kernel or CPU does not support the requested speculation +.IR misfeature . .SH STANDARDS Linux. .SH HISTORY +Linux 4.17. .SH SEE ALSO .BR prctl (2), .BR PR_SET_SPECULATION_CTRL (2const)