]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - arch/x86/kvm/cpuid.c
KVM: SVM: Implement VIRT_SPEC_CTRL support for SSBD
[mirror_ubuntu-artful-kernel.git] / arch / x86 / kvm / cpuid.c
index 14f5cf5c7bf4ea8f70c52773cad70cfe1586a29c..a6199c9c1b63421d9201a23c8e67360570921902 100644 (file)
@@ -394,7 +394,7 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
 
        /* cpuid 0x80000008.0.ebx */
        const u32 kvm_cpuid_80000008_0_ebx_x86_features =
-               F(AMD_IBPB);
+               F(AMD_IBPB) | F(VIRT_SSBD);
 
        /* all calls to cpuid_count() should be made on the same cpu */
        get_cpu();
@@ -631,8 +631,12 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
                entry->eax = g_phys_as | (virt_as << 8);
                if (boot_cpu_has(X86_FEATURE_AMD_IBPB))
                        entry->ebx |= F(AMD_IBPB);
+               if (boot_cpu_has(X86_FEATURE_VIRT_SSBD))
+                       entry->ebx |= F(VIRT_SSBD);
                entry->ebx &= kvm_cpuid_80000008_0_ebx_x86_features;
                cpuid_mask(&entry->ebx, CPUID_8000_0008_EBX);
+               if (boot_cpu_has(X86_FEATURE_LS_CFG_SSBD))
+                       entry->ebx |= F(VIRT_SSBD);
                entry->edx = 0;
                break;
        }