Merge branch 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 30 Jan 2018 03:08:02 +0000 (19:08 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 30 Jan 2018 03:08:02 +0000 (19:08 -0800)
Pull x86/pti updates from Thomas Gleixner:
 "Another set of melted spectrum related changes:

   - Code simplifications and cleanups for RSB and retpolines.

   - Make the indirect calls in KVM speculation safe.

   - Whitelist CPUs which are known not to speculate from Meltdown and
     prepare for the new CPUID flag which tells the kernel that a CPU is
     not affected.

   - A less rigorous variant of the module retpoline check which merily
     warns when a non-retpoline protected module is loaded and reflects
     that fact in the sysfs file.

   - Prepare for Indirect Branch Prediction Barrier support.

   - Prepare for exposure of the Speculation Control MSRs to guests, so
     guest OSes which depend on those "features" can use them. Includes
     a blacklist of the broken microcodes. The actual exposure of the
     MSRs through KVM is still being worked on"

* 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/speculation: Simplify indirect_branch_prediction_barrier()
  x86/retpoline: Simplify vmexit_fill_RSB()
  x86/cpufeatures: Clean up Spectre v2 related CPUID flags
  x86/cpu/bugs: Make retpoline module warning conditional
  x86/bugs: Drop one "mitigation" from dmesg
  x86/nospec: Fix header guards names
  x86/alternative: Print unadorned pointers
  x86/speculation: Add basic IBPB (Indirect Branch Prediction Barrier) support
  x86/cpufeature: Blacklist SPEC_CTRL/PRED_CMD on early Spectre v2 microcodes
  x86/pti: Do not enable PTI on CPUs which are not vulnerable to Meltdown
  x86/msr: Add definitions for new speculation control MSRs
  x86/cpufeatures: Add AMD feature bits for Speculation Control
  x86/cpufeatures: Add Intel feature bits for Speculation Control
  x86/cpufeatures: Add CPUID_7_EDX CPUID leaf
  module/retpoline: Warn about missing retpoline in module
  KVM: VMX: Make indirect call speculation safe
  KVM: x86: Make indirect calls in emulator speculation safe

15 files changed:
1  2 
arch/x86/entry/entry_64.S
arch/x86/include/asm/cpufeatures.h
arch/x86/include/asm/disabled-features.h
arch/x86/include/asm/msr-index.h
arch/x86/include/asm/processor.h
arch/x86/kernel/alternative.c
arch/x86/kernel/cpu/common.c
arch/x86/kernel/cpu/intel.c
arch/x86/kernel/cpu/scattered.c
arch/x86/kvm/emulate.c
arch/x86/kvm/vmx.c
arch/x86/lib/Makefile
include/linux/module.h
kernel/module.c
scripts/mod/modpost.c

Simple merge
  #define X86_FEATURE_PROC_FEEDBACK     ( 7*32+ 9) /* AMD ProcFeedbackInterface */
  #define X86_FEATURE_SME                       ( 7*32+10) /* AMD Secure Memory Encryption */
  #define X86_FEATURE_PTI                       ( 7*32+11) /* Kernel Page Table Isolation enabled */
- #define X86_FEATURE_RETPOLINE         ( 7*32+12) /* Generic Retpoline mitigation for Spectre variant 2 */
- #define X86_FEATURE_RETPOLINE_AMD     ( 7*32+13) /* AMD Retpoline mitigation for Spectre variant 2 */
+ #define X86_FEATURE_RETPOLINE         ( 7*32+12) /* "" Generic Retpoline mitigation for Spectre variant 2 */
+ #define X86_FEATURE_RETPOLINE_AMD     ( 7*32+13) /* "" AMD Retpoline mitigation for Spectre variant 2 */
  #define X86_FEATURE_INTEL_PPIN                ( 7*32+14) /* Intel Processor Inventory Number */
- #define X86_FEATURE_AVX512_4VNNIW     ( 7*32+16) /* AVX-512 Neural Network Instructions */
- #define X86_FEATURE_AVX512_4FMAPS     ( 7*32+17) /* AVX-512 Multiply Accumulation Single precision */
 +#define X86_FEATURE_CDP_L2            ( 7*32+15) /* Code and Data Prioritization L2 */
  
  #define X86_FEATURE_MBA                       ( 7*32+18) /* Memory Bandwidth Allocation */
- #define X86_FEATURE_RSB_CTXSW         ( 7*32+19) /* Fill RSB on context switches */
+ #define X86_FEATURE_RSB_CTXSW         ( 7*32+19) /* "" Fill RSB on context switches */
+ #define X86_FEATURE_USE_IBPB          ( 7*32+21) /* "" Indirect Branch Prediction Barrier enabled */
  
  /* Virtualization flags: Linux defined, word 8 */
  #define X86_FEATURE_TPR_SHADOW                ( 8*32+ 0) /* Intel TPR Shadow */
@@@ -75,8 -69,9 +75,9 @@@
  #define DISABLED_MASK13       0
  #define DISABLED_MASK14       0
  #define DISABLED_MASK15       0
 -#define DISABLED_MASK16       (DISABLE_PKU|DISABLE_OSPKE|DISABLE_LA57)
 +#define DISABLED_MASK16       (DISABLE_PKU|DISABLE_OSPKE|DISABLE_LA57|DISABLE_UMIP)
  #define DISABLED_MASK17       0
- #define DISABLED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 18)
+ #define DISABLED_MASK18       0
+ #define DISABLED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 19)
  
  #endif /* _ASM_X86_DISABLED_FEATURES_H */
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -24,9 -24,10 +24,10 @@@ lib-y := delay.o misc.o cmdline.o cpu.
  lib-y += usercopy_$(BITS).o usercopy.o getuser.o putuser.o
  lib-y += memcpy_$(BITS).o
  lib-$(CONFIG_RWSEM_XCHGADD_ALGORITHM) += rwsem.o
 -lib-$(CONFIG_INSTRUCTION_DECODER) += insn.o inat.o
 +lib-$(CONFIG_INSTRUCTION_DECODER) += insn.o inat.o insn-eval.o
  lib-$(CONFIG_RANDOMIZE_BASE) += kaslr.o
  lib-$(CONFIG_RETPOLINE) += retpoline.o
+ OBJECT_FILES_NON_STANDARD_retpoline.o :=y
  
  obj-y += msr.o msr-reg.o msr-reg-export.o hweight.o
  
Simple merge
diff --cc kernel/module.c
Simple merge
Simple merge