]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
x86/kvm: Expose X86_FEATURE_MD_CLEAR to guests
authorAndi Kleen <ak@linux.intel.com>
Sat, 19 Jan 2019 00:50:23 +0000 (16:50 -0800)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 6 May 2019 16:58:12 +0000 (18:58 +0200)
X86_FEATURE_MD_CLEAR is a new CPUID bit which is set when microcode
provides the mechanism to invoke a flush of various exploitable CPU buffers
by invoking the VERW instruction.

Hand it through to guests so they can adjust their mitigations.

This also requires corresponding qemu changes, which are available
separately.

[ tglx: Massaged changelog ]

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
CVE-2018-12126
CVE-2018-12127
CVE-2018-12130

(cherry picked from commit 1789c4f11b6cefc067e405233084a6b9f072f579)
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
arch/x86/kvm/cpuid.c

index bc0678824de15dc4521864cdaad256d97397af32..53c040a5f95cc5c4ab1a319f4c2e94acd31339da 100644 (file)
@@ -397,7 +397,8 @@ 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 =
                F(AVX512_4VNNIW) | F(AVX512_4FMAPS) | F(SPEC_CTRL) |
-               F(SPEC_CTRL_SSBD) | F(ARCH_CAPABILITIES) | F(INTEL_STIBP);
+               F(SPEC_CTRL_SSBD) | F(ARCH_CAPABILITIES) | F(INTEL_STIBP) |
+               F(MD_CLEAR);
 
        /* all calls to cpuid_count() should be made on the same cpu */
        get_cpu();