Commit 74bee0ca authored by Jim Mattson's avatar Jim Mattson Committed by Paolo Bonzini

KVM: x86: Advertise that the SMM_CTL MSR is not supported

CPUID.80000021H:EAX[bit 9] indicates that the SMM_CTL MSR (0xc0010116) is
not supported. This defeature can be advertised by KVM_GET_SUPPORTED_CPUID
regardless of whether or not the host enumerates it; currently it will be
included only if the host enumerates at least leaf 8000001DH, due to a
preexisting bug in QEMU that KVM has to work around (commit f751d8ea,
"KVM: x86: work around QEMU issue with synthetic CPUID leaves", 2022-04-29).
Signed-off-by: default avatarJim Mattson <jmattson@google.com>
Message-Id: <20221007221644.138355-1-jmattson@google.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 0c2a0412
...@@ -1233,8 +1233,12 @@ static inline int __do_cpuid_func(struct kvm_cpuid_array *array, u32 function) ...@@ -1233,8 +1233,12 @@ static inline int __do_cpuid_func(struct kvm_cpuid_array *array, u32 function)
* Other defined bits are for MSRs that KVM does not expose: * Other defined bits are for MSRs that KVM does not expose:
* EAX 3 SPCL, SMM page configuration lock * EAX 3 SPCL, SMM page configuration lock
* EAX 13 PCMSR, Prefetch control MSR * EAX 13 PCMSR, Prefetch control MSR
*
* KVM doesn't support SMM_CTL.
* EAX 9 SMM_CTL MSR is not supported
*/ */
entry->eax &= BIT(0) | BIT(2) | BIT(6); entry->eax &= BIT(0) | BIT(2) | BIT(6);
entry->eax |= BIT(9);
if (static_cpu_has(X86_FEATURE_LFENCE_RDTSC)) if (static_cpu_has(X86_FEATURE_LFENCE_RDTSC))
entry->eax |= BIT(2); entry->eax |= BIT(2);
if (!static_cpu_has_bug(X86_BUG_NULL_SEG)) if (!static_cpu_has_bug(X86_BUG_NULL_SEG))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment