Skip to content

Commit 0abcc8f

Browse files
Maxim Levitskybonzini
authored andcommitted
KVM: VMX: enable X86_FEATURE_WAITPKG in KVM capabilities
Even though we might not allow the guest to use WAITPKG's new instructions, we should tell KVM that the feature is supported by the host CPU. Note that vmx_waitpkg_supported checks that WAITPKG _can_ be set in secondary execution controls as specified by VMX capability MSR, rather that we actually enable it for a guest. Cc: [email protected] Fixes: e69e72f ("KVM: x86: Add support for user wait instructions") Suggested-by: Paolo Bonzini <[email protected]> Signed-off-by: Maxim Levitsky <[email protected]> Message-Id: <[email protected]> Reviewed-by: Sean Christopherson <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 6129ed8 commit 0abcc8f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

arch/x86/kvm/vmx/vmx.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7138,6 +7138,9 @@ static __init void vmx_set_cpu_caps(void)
71387138
/* CPUID 0x80000001 */
71397139
if (!cpu_has_vmx_rdtscp())
71407140
kvm_cpu_cap_clear(X86_FEATURE_RDTSCP);
7141+
7142+
if (vmx_waitpkg_supported())
7143+
kvm_cpu_cap_check_and_set(X86_FEATURE_WAITPKG);
71417144
}
71427145

71437146
static void vmx_request_immediate_exit(struct kvm_vcpu *vcpu)

0 commit comments

Comments
 (0)