[patch V2 00/28] x86/speculation: Remedy the STIBP/IBPB overhead

From: Thomas Gleixner
Date: Sun Nov 25 2018 - 13:59:38 EST


Thats hopefully the final version of this. Changes since V1:

- Renamed the command line option and related code to spectre_v2_user= as
suggested by Josh.

- Thought more about the back to back optimization and finally left the
IBPB code in switch_mm().

It still removes the ptrace check for the always IBPB case. That's
substantial overhead for dubious value now that the default is
conditional (prctl/seccomp) IBPB.

- Added two options which allow conditional STIBP and IBPB always mode.

- Addressed the review comments

Documentation is still work in progress. Thanks Andi for providing the
first draft for it.

Still based on tip.git x86/pti as it has been discussed to remove the
minimal RETPOLINE bandaid from stable kernels as well.

It's avaiable from git:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git WIP.x86/pti


Thanks,

tglx

8<------------------------

Documentation/admin-guide/kernel-parameters.txt | 56 ++
Documentation/userspace-api/spec_ctrl.rst | 9
arch/x86/Kconfig | 8
arch/x86/include/asm/msr-index.h | 5
arch/x86/include/asm/nospec-branch.h | 14
arch/x86/include/asm/spec-ctrl.h | 18
arch/x86/include/asm/switch_to.h | 3
arch/x86/include/asm/thread_info.h | 18
arch/x86/include/asm/tlbflush.h | 8
arch/x86/kernel/cpu/bugs.c | 520 ++++++++++++++++++------
arch/x86/kernel/process.c | 79 ++-
arch/x86/kernel/process.h | 39 +
arch/x86/kernel/process_32.c | 10
arch/x86/kernel/process_64.c | 10
arch/x86/mm/tlb.c | 109 +++--
include/linux/ptrace.h | 17
include/linux/sched.h | 9
include/linux/sched/smt.h | 20
include/uapi/linux/prctl.h | 1
kernel/cpu.c | 15
kernel/ptrace.c | 10
kernel/sched/core.c | 19
kernel/sched/sched.h | 4
tools/include/uapi/linux/prctl.h | 1
24 files changed, 745 insertions(+), 257 deletions(-)