|
@@ -379,7 +379,8 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
|
|
|
|
|
|
/* cpuid 0x80000008.ebx */
|
|
|
const u32 kvm_cpuid_8000_0008_ebx_x86_features =
|
|
|
- F(AMD_IBPB) | F(AMD_IBRS) | F(VIRT_SSBD) | F(AMD_SSB_NO);
|
|
|
+ F(AMD_IBPB) | F(AMD_IBRS) | F(AMD_SSBD) | F(VIRT_SSBD) |
|
|
|
+ F(AMD_SSB_NO);
|
|
|
|
|
|
/* cpuid 0xC0000001.edx */
|
|
|
const u32 kvm_cpuid_C000_0001_edx_x86_features =
|
|
@@ -664,7 +665,12 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
|
|
|
entry->ebx |= F(VIRT_SSBD);
|
|
|
entry->ebx &= kvm_cpuid_8000_0008_ebx_x86_features;
|
|
|
cpuid_mask(&entry->ebx, CPUID_8000_0008_EBX);
|
|
|
- if (boot_cpu_has(X86_FEATURE_LS_CFG_SSBD))
|
|
|
+ /*
|
|
|
+ * The preference is to use SPEC CTRL MSR instead of the
|
|
|
+ * VIRT_SPEC MSR.
|
|
|
+ */
|
|
|
+ if (boot_cpu_has(X86_FEATURE_LS_CFG_SSBD) &&
|
|
|
+ !boot_cpu_has(X86_FEATURE_AMD_SSBD))
|
|
|
entry->ebx |= F(VIRT_SSBD);
|
|
|
break;
|
|
|
}
|