]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
x86/cpu: Add the 'setcpuid=' boot parameter
authorBrendan Jackman <jackmanb@google.com>
Fri, 20 Dec 2024 15:18:32 +0000 (15:18 +0000)
committerIngo Molnar <mingo@kernel.org>
Fri, 28 Feb 2025 09:57:49 +0000 (10:57 +0100)
commit814165e9fd1f62332b5444d730b8d6e432328463
tree00b7d4e688b369ec2554fb7adaa3f4c07749f523
parentf034937f5af32188cd1c07865c885b2f171e17bf
x86/cpu: Add the 'setcpuid=' boot parameter

In preparation for adding support to inject fake CPU bugs at boot-time,
add a general facility to force enablement of CPU flags.

The flag taints the kernel and the documentation attempts to be clear
that this is highly unsuitable for uses outside of kernel development
and platform experimentation.

The new arg is parsed just like clearcpuid, but instead of leading to
setup_clear_cpu_cap() it leads to setup_force_cpu_cap().

I've tested this by booting a nested QEMU guest on an Intel host, which
with setcpuid=svm will claim that it supports AMD virtualization.

Signed-off-by: Brendan Jackman <jackmanb@google.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20241220-force-cpu-bug-v2-2-7dc71bce742a@google.com
arch/x86/kernel/cpu/common.c