From: Brendan Jackman <jackmanb@google.com>
To: Jonathan Corbet <corbet@lwn.net>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
Peter Zijlstra <peterz@infradead.org>
Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
Brendan Jackman <jackmanb@google.com>
Subject: [PATCH v2 0/3] x86/cpu: Add facility to force-enable CPU caps and bugs
Date: Fri, 20 Dec 2024 15:18:30 +0000 [thread overview]
Message-ID: <20241220-force-cpu-bug-v2-0-7dc71bce742a@google.com> (raw)
For testing, development, and experimentation, add the ability to force
the kernel to behave as if the CPU has a bug, even if it doesn't, using
a command-line param.
Also do this in general for CPU flags, since:
- The infrastructure is the same so there is almost no extra
implementation complexity.
- While setting random CPU flags is certain to break the kernel in
mysterious and horrifying ways, this is not dramatically worse than
setting CPU bugs. Although CPU bug mitigations don't have any very
obvious ways to break the system if run on the wrong hardware, it's
still very much an unsupported configuration, even beyond the
security concern implied breaking mitigation logic.
Since a taint and scary docs are necessary regardless, supporting
arbitrary CPU flags doesn't add significant maintenance/support
burden either.
Signed-off-by: Brendan Jackman <jackmanb@google.com>
---
Changes in v2:
- Switched from a bugs-only force_cpu_bug= to a more general setcpuid=.
- Made it taint the kernel.
- Made docs sound scarier.
- Spellchecked and avoided new usage of personal pronouns.
- Link to v1: https://lore.kernel.org/r/20241119-force-cpu-bug-v1-1-2aa31c6c1ccf@google.com
---
Brendan Jackman (3):
x86/cpu: Create helper to parse clearcpuid param
x86/cpu: Add setcpuid cmdline param
x86/cpu: Enable modifying bug flags with {clear,set}puid
arch/x86/include/asm/cpufeature.h | 1 +
arch/x86/kernel/cpu/common.c | 139 +++++++++++++++++++++++---------------
2 files changed, 87 insertions(+), 53 deletions(-)
---
base-commit: eabcdba3ad4098460a376538df2ae36500223c1e
change-id: 20241119-force-cpu-bug-94a08ab0239f
Best regards,
--
Brendan Jackman <jackmanb@google.com>
next reply other threads:[~2024-12-20 15:18 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-20 15:18 Brendan Jackman [this message]
2024-12-20 15:18 ` [PATCH v2 1/3] x86/cpu: Create helper to parse clearcpuid param Brendan Jackman
2024-12-20 15:18 ` [PATCH v2 2/3] x86/cpu: Add setcpuid cmdline param Brendan Jackman
2024-12-20 15:18 ` [PATCH v2 3/3] x86/cpu: Enable modifying bug flags with {clear,set}puid Brendan Jackman
2025-01-13 15:42 ` [PATCH v2 0/3] x86/cpu: Add facility to force-enable CPU caps and bugs Brendan Jackman
2025-02-28 10:07 ` Ingo Molnar
2025-02-28 16:29 ` Ingo Molnar
2025-03-03 14:41 ` Brendan Jackman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241220-force-cpu-bug-v2-0-7dc71bce742a@google.com \
--to=jackmanb@google.com \
--cc=bp@alien8.de \
--cc=corbet@lwn.net \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).