Skip to content

Commit faabfcb

Browse files
kimphillamdbp3tk0v
authored andcommitted
x86/cpu, kvm: Add the SMM_CTL MSR not present feature
The SMM_CTL MSR not present feature was being open-coded for KVM. Add it to its newly added CPUID leaf 0x80000021 EAX proper. Also drop the bit description comments now the code is more self-describing. Signed-off-by: Kim Phillips <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Acked-by: Sean Christopherson <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 5b909d4 commit faabfcb

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

arch/x86/include/asm/cpufeatures.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,7 @@
431431
#define X86_FEATURE_NO_NESTED_DATA_BP (20*32+ 0) /* "" No Nested Data Breakpoints */
432432
#define X86_FEATURE_LFENCE_RDTSC (20*32+ 2) /* "" LFENCE always serializing / synchronizes RDTSC */
433433
#define X86_FEATURE_NULL_SEL_CLR_BASE (20*32+ 6) /* "" Null Selector Clears Base */
434+
#define X86_FEATURE_NO_SMM_CTL_MSR (20*32+ 9) /* "" SMM_CTL MSR is not present */
434435

435436
/*
436437
* BUG word(s)

arch/x86/kvm/cpuid.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ void kvm_set_cpu_caps(void)
760760
kvm_cpu_cap_set(X86_FEATURE_LFENCE_RDTSC);
761761
if (!static_cpu_has_bug(X86_BUG_NULL_SEG))
762762
kvm_cpu_cap_set(X86_FEATURE_NULL_SEL_CLR_BASE);
763-
kvm_cpu_caps[CPUID_8000_0021_EAX] |= BIT(9) /* NO_SMM_CTL_MSR */;
763+
kvm_cpu_cap_set(X86_FEATURE_NO_SMM_CTL_MSR);
764764

765765
kvm_cpu_cap_mask(CPUID_C000_0001_EDX,
766766
F(XSTORE) | F(XSTORE_EN) | F(XCRYPT) | F(XCRYPT_EN) |

0 commit comments

Comments
 (0)