]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-5.0/0005-x86-kvm-Expose-X86_FEATURE_MD_CLEAR-to-guests.patch
Linux 5.1.2
[thirdparty/kernel/stable-queue.git] / queue-5.0 / 0005-x86-kvm-Expose-X86_FEATURE_MD_CLEAR-to-guests.patch
1 From 44e83212c81e9088be89b4c2219ba609c6639ad1 Mon Sep 17 00:00:00 2001
2 From: Andi Kleen <ak@linux.intel.com>
3 Date: Fri, 18 Jan 2019 16:50:23 -0800
4 Subject: [PATCH 05/27] x86/kvm: Expose X86_FEATURE_MD_CLEAR to guests
5
6 commit 6c4dbbd14730c43f4ed808a9c42ca41625925c22 upstream
7
8 X86_FEATURE_MD_CLEAR is a new CPUID bit which is set when microcode
9 provides the mechanism to invoke a flush of various exploitable CPU buffers
10 by invoking the VERW instruction.
11
12 Hand it through to guests so they can adjust their mitigations.
13
14 This also requires corresponding qemu changes, which are available
15 separately.
16
17 [ tglx: Massaged changelog ]
18
19 Signed-off-by: Andi Kleen <ak@linux.intel.com>
20 Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
21 Reviewed-by: Borislav Petkov <bp@suse.de>
22 Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
23 Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
24 Reviewed-by: Jon Masters <jcm@redhat.com>
25 Tested-by: Jon Masters <jcm@redhat.com>
26 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
27 ---
28 arch/x86/kvm/cpuid.c | 3 ++-
29 1 file changed, 2 insertions(+), 1 deletion(-)
30
31 diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
32 index c07958b59f50..39501e7afdb4 100644
33 --- a/arch/x86/kvm/cpuid.c
34 +++ b/arch/x86/kvm/cpuid.c
35 @@ -410,7 +410,8 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
36 /* cpuid 7.0.edx*/
37 const u32 kvm_cpuid_7_0_edx_x86_features =
38 F(AVX512_4VNNIW) | F(AVX512_4FMAPS) | F(SPEC_CTRL) |
39 - F(SPEC_CTRL_SSBD) | F(ARCH_CAPABILITIES) | F(INTEL_STIBP);
40 + F(SPEC_CTRL_SSBD) | F(ARCH_CAPABILITIES) | F(INTEL_STIBP) |
41 + F(MD_CLEAR);
42
43 /* all calls to cpuid_count() should be made on the same cpu */
44 get_cpu();
45 --
46 2.21.0
47