]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: x86: Quirk initialization of feature MSRs to KVM's max configuration
authorSean Christopherson <seanjc@google.com>
Fri, 2 Aug 2024 18:55:05 +0000 (11:55 -0700)
committerSean Christopherson <seanjc@google.com>
Fri, 1 Nov 2024 16:22:31 +0000 (09:22 -0700)
commitdcb988cdac85bad177de86fbf409524eda4f9467
tree568a19ac2ef88c59979327c44f8e0d5390313bd4
parentbc2ca3680b30869ee9a764ab72c143070f1afec8
KVM: x86: Quirk initialization of feature MSRs to KVM's max configuration

Add a quirk to control KVM's misguided initialization of select feature
MSRs to KVM's max configuration, as enabling features by default violates
KVM's approach of letting userspace own the vCPU model, and is actively
problematic for MSRs that are conditionally supported, as the vCPU will
end up with an MSR value that userspace can't restore.  E.g. if the vCPU
is configured with PDCM=0, userspace will save and attempt to restore a
non-zero PERF_CAPABILITIES, thanks to KVM's meddling.

Link: https://lore.kernel.org/r/20240802185511.305849-4-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Documentation/virt/kvm/api.rst
arch/x86/include/asm/kvm_host.h
arch/x86/include/uapi/asm/kvm.h
arch/x86/kvm/svm/svm.c
arch/x86/kvm/vmx/vmx.c
arch/x86/kvm/x86.c