x86/speculation: Remedy the STIBP/IBPB overhead
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest28 patches 55 repliesIn review
- v124 patches 69 repliesSuperseded
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/28 | x86/speculation: Update the TIF_SSBD commentarch/ | +1 | 1 reply | |
| 2/28 | x86/speculation: Clean up spectre_v2_parse_cmdline()arch/ | +13 | 1 reply | |
| 3/28 | x86/speculation: Remove unnecessary ret variable in cpu_show_common()arch/ | +1 | 1 reply | |
| 4/28 | x86/speculation: Reorganize cpu_show_common()arch/ | +18 | 2 replies | |
| 5/28 | x86/speculation: Disable STIBP when enhanced IBRS is in usearch/ | +7 | 1 reply | |
| 6/28 | x86/speculation: Rename SSBD update functionsarch/ arch/ arch/ | +11 | 2 replies | |
| 7/28 | x86/speculation: Reorganize speculation control MSRs updatearch/ | +32 | 2 replies | |
| 8/28 | sched/smt: Make sched_smt_present track topologykernel/ | +11 | 3 replies | |
| 9/28 | x86/Kconfig: Select SCHED_SMT if SMP enabledarch/ | +1 | 1 reply | |
| 10/28 | sched/smt: Expose sched_smt_present static keyinclude/ kernel/ | +19 | 1 reply | |
| 11/28 | x86/speculation: Rework SMT state changearch/ include/ kernel/ | +16 | 0 replies | |
| 12/28 | x86/l1tf: Show actual SMT statearch/ | +3 | 0 replies | |
| 13/28 | x86/speculation: Reorder the spec_v2 codearch/ | +84 | 1 reply | |
| 14/28 | x86/speculation: Mark string arrays const correctlyarch/ | +3 | 0 replies | |
| 15/28 | x86/speculataion: Mark command line parser data __initdataarch/ | +2 | 0 replies | |
| 16/28 | x86/speculation: Unify conditional spectre v2 print functionsarch/ | +4 | 0 replies | |
| 17/28 | x86/speculation: Add command line control for indirect branch speculationDocumentation/ arch/ arch/ | +156 | 0 replies | |
| 18/28 | x86/speculation: Prepare for per task indirect branch speculation controlarch/ arch/ arch/ +2 more | +44 | 6 replies | |
| 19/28 | x86/process: Consolidate and simplify switch_to_xtra() codearch/ arch/ arch/ +2 more | +37 | 1 reply | |
| 20/28 | x86/speculation: Avoid __switch_to_xtra() callsarch/ arch/ | +26 | 0 replies | |
| 21/28 | x86/speculation: Prepare for conditional IBPB in switch_mm()arch/ arch/ arch/ +1 more | +110 | 8 replies | |
| 22/28 | ptrace: Remove unused ptrace_may_access_sched() and MODE_IBRSinclude/ kernel/ | +0 | 0 replies | |
| 23/28 | x86/speculation: Split out TIF updatearch/ | +23 | 0 replies | |
| 24/28 | x86/speculation: Prepare arch_smt_update() for PRCTL modearch/ | +25 | 3 replies | |
| 25/28 | x86/speculation: Add prctl() control for indirect branch speculationDocumentation/ arch/ arch/ +3 more | +88 | 0 replies | |
| 26/28 | x86/speculation: Enable prctl mode for spectre_v2_userDocumentation/ arch/ | +38 | 1 reply | |
| 27/28 | x86/speculation: Add seccomp Spectre v2 user space protection modeDocumentation/ arch/ arch/ | +25 | 16 replies | |
| 28/28 | x86/speculation: Provide IBPB always command line optionsDocumentation/ arch/ | +35 | 0 replies |
Reviews trailers per patch
10 of 28 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Tim Chen | Thomas Lendacky | Ingo Molnar | Konrad Rzeszutek Wilk |
|---|---|---|---|---|
| Series | R-b | |||
| 1/28 | R-b | |||
| 2/28 | R-b | |||
| 3/28 | R-b | |||
| 4/28 | R-b | |||
| 5/28 | R-b | |||
| 6/28 | R-b | |||
| 7/28 | Originally-by | R-b | ||
| 8/28 | R-b | |||
| 9/28 | R-b | |||
| 10/28 | R-b | |||
| 11/28 | ||||
| 12/28 | ||||
| 13/28 | ||||
| 14/28 | ||||
| 15/28 | ||||
| 16/28 | ||||
| 17/28 | Originally-by | |||
| 18/28 | ||||
| 19/28 | ||||
| 20/28 | ||||
| 21/28 | ||||
| 22/28 | ||||
| 23/28 | ||||
| 24/28 | ||||
| 25/28 | ||||
| 26/28 | ||||
| 27/28 | ||||
| 28/28 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.
Cover letter [patch V2 00/28] x86/speculation: Remedy the STIBP/IBPB overhead
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(-)