]> git.ipfire.org Git - thirdparty/linux.git/commit
KVM: selftests: Add a CPUID testcase for KVM_SET_CPUID2 with runtime updates
authorSean Christopherson <seanjc@google.com>
Tue, 2 Dec 2025 01:50:49 +0000 (17:50 -0800)
committerSean Christopherson <seanjc@google.com>
Tue, 2 Dec 2025 16:49:32 +0000 (08:49 -0800)
commit824d227324dcd328857b70e37b41780f02225729
tree20d038a06ac110cf210ce3c8873aeed012d24048
parente2b43fb25243d502ad36b07bab9de09f4b76fff9
KVM: selftests: Add a CPUID testcase for KVM_SET_CPUID2 with runtime updates

Add a CPUID testcase to verify that KVM allows KVM_SET_CPUID2 after (or in
conjunction with) runtime updates.  This is a regression test for the bug
introduced by commit 93da6af3ae56 ("KVM: x86: Defer runtime updates of
dynamic CPUID bits until CPUID emulation"), where KVM would incorrectly
reject KVM_SET_CPUID due to a not handling a pending runtime update on the
current CPUID, resulting in a false mismatch between the "old" and "new"
CPUID entries.

Link: https://lore.kernel.org/all/20251128123202.68424a95@imammedo
Link: https://patch.msgid.link/20251202015049.1167490-3-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
tools/testing/selftests/kvm/x86/cpuid_test.c