* [PATCH] Documentation/x86: Fix PR_SET_SPECULATION_CTRL error codes
@ 2025-10-30 13:59 Brendan Jackman
2025-10-30 15:49 ` Brendan Jackman
0 siblings, 1 reply; 2+ messages in thread
From: Brendan Jackman @ 2025-10-30 13:59 UTC (permalink / raw)
To: Brendan Jackman, Jonathan Corbet, Thomas Gleixner,
Borislav Petkov, Peter Zijlstra, Josh Poimboeuf, Pawan Gupta,
Balbir Singh, linux-doc, linux-kernel
If you force-disable mitigations on the kcmdline, for SPEC_STORE_BYPASS
this ends up with the prctl returning -ENXIO, but contrary to the
current docs for the other controls it returns -EPERM. Fix that.
Note that this return value should probably be considered a bug. But,
making the behaviour consistent with the current docs seems more likely
to break existing users than help anyone out in practice, so just "fix"
it by specifying it as correct.
Since this is getting more wordy and confusing, also be more explicit
about "control is not possible" be mentioning the boot configuration, to
better distinguish this case conceptually from the FORCE_DISABLE failure
mode.
Signed-off-by: Brendan Jackman <jackmanb@google.com>
---
Documentation/userspace-api/spec_ctrl.rst | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/Documentation/userspace-api/spec_ctrl.rst b/Documentation/userspace-api/spec_ctrl.rst
index ca89151fc0a8e7205e0a0062134d63b213b9ef11..806947a093e5e71cd23a6a1644db8654b870844a 100644
--- a/Documentation/userspace-api/spec_ctrl.rst
+++ b/Documentation/userspace-api/spec_ctrl.rst
@@ -81,11 +81,15 @@ Value Meaning
ERANGE arg3 is incorrect, i.e. it's neither PR_SPEC_ENABLE nor
PR_SPEC_DISABLE nor PR_SPEC_FORCE_DISABLE.
-ENXIO Control of the selected speculation misfeature is not possible.
- See PR_GET_SPECULATION_CTRL.
+ENXIO For PR_SPEC_STORE_BYPASS: control of the selected speculation misfeature
+ is not possible via prctl, because of the system's boot configuration.
+
+EPERM Speculation was disabled with PR_SPEC_FORCE_DISABLE and caller tried to
+ enable it again.
+
+EPERM For PR_SPEC_STORE_BYPASS and PR_SPEC_INDIRECT_BRANCH: control of the
+ mitigation is not possible because of the system's boot configuration.
-EPERM Speculation was disabled with PR_SPEC_FORCE_DISABLE and caller
- tried to enable it again.
======= =================================================================
Speculation misfeature controls
---
base-commit: 131f3d9446a6075192cdd91f197989d98302faa6
change-id: 20251030-b4-prctl-docs-2-d5e24dbb758d
Best regards,
--
Brendan Jackman <jackmanb@google.com>
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] Documentation/x86: Fix PR_SET_SPECULATION_CTRL error codes
2025-10-30 13:59 [PATCH] Documentation/x86: Fix PR_SET_SPECULATION_CTRL error codes Brendan Jackman
@ 2025-10-30 15:49 ` Brendan Jackman
0 siblings, 0 replies; 2+ messages in thread
From: Brendan Jackman @ 2025-10-30 15:49 UTC (permalink / raw)
To: Brendan Jackman, Jonathan Corbet, Thomas Gleixner,
Borislav Petkov, Peter Zijlstra, Josh Poimboeuf, Pawan Gupta,
Balbir Singh, linux-doc, linux-kernel, aesa
On Thu Oct 30, 2025 at 1:59 PM UTC, Brendan Jackman wrote:
> -ENXIO Control of the selected speculation misfeature is not possible.
> - See PR_GET_SPECULATION_CTRL.
> +ENXIO For PR_SPEC_STORE_BYPASS: control of the selected speculation misfeature
> + is not possible via prctl, because of the system's boot configuration.
> +
> +EPERM Speculation was disabled with PR_SPEC_FORCE_DISABLE and caller tried to
> + enable it again.
> +
> +EPERM For PR_SPEC_STORE_BYPASS and PR_SPEC_INDIRECT_BRANCH: control of the
Ugh, ^^^^^^^^^^^^^^^^^^^^ that should be PR_SPEC_L1D_FLUSH
I will wait a day or two before v2 in case anyone else spots other
mistakes or has other comments.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-10-30 15:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-30 13:59 [PATCH] Documentation/x86: Fix PR_SET_SPECULATION_CTRL error codes Brendan Jackman
2025-10-30 15:49 ` Brendan Jackman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).