]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
KVM: VMX: Expose SSBD properly to guests.
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Mon, 21 May 2018 21:54:49 +0000 (17:54 -0400)
committerStefan Bader <stefan.bader@canonical.com>
Thu, 24 May 2018 07:59:19 +0000 (09:59 +0200)
The X86_FEATURE_SSBD is an synthetic CPU feature - that is
it bit location has no relevance to the real CPUID 0x7.EBX[31]
bit position. For that we need the new CPU feature name.

Fixes: 52817587e706 ("x86/cpufeatures: Disentangle SSBD enumeration")
CC: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Radim Krčmář" <rkrcmar@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: stable@vger.kernel.org
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
CVE-2018-3639 (x86)

(backported from https://patchwork.kernel.org/patch/10416823/)
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
arch/x86/kernel/cpu/scattered.c
arch/x86/kvm/cpuid.c

index d0295774a48549a6de80da3d806419b0f995f7bc..029e2ce20d12e94be17aa0bc12bbb03294fe1289 100644 (file)
@@ -26,7 +26,7 @@ static const struct cpuid_bit cpuid_bits[] = {
        { X86_FEATURE_AVX512_4FMAPS,    CPUID_EDX,  3, 0x00000007, 0 },
        { X86_FEATURE_SPEC_CTRL,        CPUID_EDX, 26, 0x00000007, 0 },
        { X86_FEATURE_ARCH_CAPABILITIES,CPUID_EDX, 29, 0x00000007, 0 },
-       { X86_FEATURE_SSBD,             CPUID_EDX, 31, 0x00000007, 0 },
+       { X86_FEATURE_SPEC_CTRL_SSBD,   CPUID_EDX, 31, 0x00000007, 0 },
        { X86_FEATURE_CAT_L3,           CPUID_EBX,  1, 0x00000010, 0 },
        { X86_FEATURE_CAT_L2,           CPUID_EBX,  2, 0x00000010, 0 },
        { X86_FEATURE_CDP_L3,           CPUID_ECX,  2, 0x00000010, 1 },
index a6199c9c1b63421d9201a23c8e67360570921902..2690ad201ed5f15f148773a4c431bf96131d28fc 100644 (file)
@@ -71,7 +71,7 @@ u64 kvm_supported_xcr0(void)
 #define KVM_CPUID_BIT_AVX512_4VNNIW     2
 #define KVM_CPUID_BIT_AVX512_4FMAPS     3
 #define KVM_CPUID_BIT_SPEC_CTRL                26
-#define KVM_CPUID_BIT_SSBD             31
+#define KVM_CPUID_BIT_SPEC_CTRL_SSBD   31
 #define KF(x) bit(KVM_CPUID_BIT_##x)
 
 int kvm_update_cpuid(struct kvm_vcpu *vcpu)
@@ -390,7 +390,7 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
        /* cpuid 7.0.edx*/
        const u32 kvm_cpuid_7_0_edx_x86_features =
                KF(AVX512_4VNNIW) | KF(AVX512_4FMAPS) |
-               KF(SPEC_CTRL) | KF(SSBD);
+               KF(SPEC_CTRL) | KF(SPEC_CTRL_SSBD);
 
        /* cpuid 0x80000008.0.ebx */
        const u32 kvm_cpuid_80000008_0_ebx_x86_features =