Merge branch 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 26 May 2018 20:24:16 +0000 (13:24 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 26 May 2018 20:24:16 +0000 (13:24 -0700)
Pull x86 store buffer fixes from Thomas Gleixner:
 "Two fixes for the SSBD mitigation code:

   - expose SSBD properly to guests. This got broken when the CPU
     feature flags got reshuffled.

   - simplify the CPU detection logic to avoid duplicate entries in the
     tables"

* 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/speculation: Simplify the CPU bug detection logic
  KVM/VMX: Expose SSBD properly to guests

1  2 
arch/x86/kvm/cpuid.c

diff --combined arch/x86/kvm/cpuid.c
index 9bffb5228f31670b790051c8aa329c2692c8ad92,598461e24be3b02ee1bb687ccc1dd98d720da0b3..92bf2f2e7cdd241d1b4019c0ed72ce72fbb95d11
@@@ -407,8 -407,8 +407,8 @@@ static inline int __do_cpuid_ent(struc
  
        /* cpuid 7.0.edx*/
        const u32 kvm_cpuid_7_0_edx_x86_features =
-               F(AVX512_4VNNIW) | F(AVX512_4FMAPS) | F(SPEC_CTRL) | F(SSBD) |
-               F(ARCH_CAPABILITIES);
+               F(AVX512_4VNNIW) | F(AVX512_4FMAPS) | F(SPEC_CTRL) |
+               F(SPEC_CTRL_SSBD) | F(ARCH_CAPABILITIES);
  
        /* all calls to cpuid_count() should be made on the same cpu */
        get_cpu();
                                entry->ecx &= ~F(PKU);
                        entry->edx &= kvm_cpuid_7_0_edx_x86_features;
                        cpuid_mask(&entry->edx, CPUID_7_EDX);
 +                      /*
 +                       * We emulate ARCH_CAPABILITIES in software even
 +                       * if the host doesn't support it.
 +                       */
 +                      entry->edx |= F(ARCH_CAPABILITIES);
                } else {
                        entry->ebx = 0;
                        entry->ecx = 0;