Skip to content

Commit 74bee0c

Browse files
jsmattsonjrbonzini
authored andcommitted
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 f751d8e, "KVM: x86: work around QEMU issue with synthetic CPUID leaves", 2022-04-29). Signed-off-by: Jim Mattson <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 0c2a041 commit 74bee0c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

arch/x86/kvm/cpuid.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,8 +1233,12 @@ static inline int __do_cpuid_func(struct kvm_cpuid_array *array, u32 function)
12331233
* Other defined bits are for MSRs that KVM does not expose:
12341234
* EAX 3 SPCL, SMM page configuration lock
12351235
* EAX 13 PCMSR, Prefetch control MSR
1236+
*
1237+
* KVM doesn't support SMM_CTL.
1238+
* EAX 9 SMM_CTL MSR is not supported
12361239
*/
12371240
entry->eax &= BIT(0) | BIT(2) | BIT(6);
1241+
entry->eax |= BIT(9);
12381242
if (static_cpu_has(X86_FEATURE_LFENCE_RDTSC))
12391243
entry->eax |= BIT(2);
12401244
if (!static_cpu_has_bug(X86_BUG_NULL_SEG))

0 commit comments

Comments
 (0)