Skip to content

RFC Fix up the recent SRSO patches

Peter Zijlstra lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest17 patches 62 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/17x86/alternative: Unconditional custom return thunkarch/x86/include/asm/nospec-branch.h arch/x86/kernel/alternative.c+0 -62 replies
2/17x86/cpu: Clean up SRSO return thunk messarch/x86/include/asm/nospec-branch.h arch/x86/kernel/cpu/bugs.c arch/x86/kernel/vmlinux.lds.S +1 more+36 -148 replies
3/17x86/cpu: Make srso_untrain_ret consistentarch/x86/lib/retpoline.S+1 -11 reply
4/17objtool/x86: Fix SRSO messtools/objtool/arch/x86/decode.c tools/objtool/check.c+2 -55 replies
5/17x86/cpu: Cleanup the untrain messarch/x86/include/asm/nospec-branch.h arch/x86/lib/retpoline.S+12 -144 replies
6/17x86/cpu: Add SRSO untrain to retbleed=arch/x86/kernel/cpu/bugs.c+76 -1116 replies
7/17x86/cpu/kvm: Provide UNTRAIN_RET_VMarch/x86/include/asm/nospec-branch.h arch/x86/kvm/svm/vmenter.S+13 -56 replies
8/17x86/cpu: Add IBPB on VMEXIT to retbleed=arch/x86/kernel/cpu/bugs.c+16 -10 replies
9/17x86: Remove CONFIG_CPU_SRSOarch/x86/Kconfig arch/x86/include/asm/nospec-branch.h arch/x86/kernel/vmlinux.lds.S +1 more+24 -241 reply
10/17x86: Remove CPU_IBPB_ENTRYarch/x86/Kconfig arch/x86/include/asm/nospec-branch.h arch/x86/kernel/cpu/bugs.c+8 -260 replies
11/17x86/cpu: Remove all SRSO interface nonsensearch/x86/kernel/cpu/bugs.c drivers/base/cpu.c include/linux/cpu.h+10 -1886 replies
12/17x86/cpu: Rename original retbleed return thunkarch/x86/include/asm/nospec-branch.h arch/x86/kernel/cpu/bugs.c arch/x86/kernel/vmlinux.lds.S +2 more+22 -178 replies
13/17objtool/x86: Add arch_is_offset_insn()tools/objtool/arch/x86/decode.c tools/objtool/check.c tools/objtool/include/objtool/arch.h +1 more+18 -32 replies
14/17objtool: Add comments to the arch_is_$foo() magic symbolstools/objtool/check.c+12 -00 replies
15/17x86/cpu: Rename srso_(.*)_alias to srso_alias_\1arch/x86/include/asm/nospec-branch.h arch/x86/kernel/vmlinux.lds.S arch/x86/lib/retpoline.S+17 -170 replies
16/17x86/alternatives: Simplify ALTERNATIVE_n()arch/x86/include/asm/alternative.h arch/x86/kernel/alternative.c tools/objtool/arch/x86/special.c +1 more+100 -1580 replies
17/17x86/cpu: Use fancy alternatives to get rid of entry_untrain_ret()arch/x86/include/asm/nospec-branch.h arch/x86/lib/retpoline.S+18 -220 replies

Reviews trailers per patch

2 of 17 patches have a Reviewed-by or Acked-by.

PatchNikolay Borisov
1/17R-b
2/17R-b
3/17
4/17
5/17
6/17
7/17
8/17
9/17
10/17
11/17
12/17
13/17
14/17
15/17
16/17
17/17

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [RFC][PATCH 00/17] Fix up the recent SRSO patches

Since I wasn't invited to the party (even though I did retbleed), I get to clean things up afterwards :/

Anyway, this here overhauls the SRSO patches in a big way.

I claim that AMD retbleed (also called Speculative-Type-Confusion -- not to be confused with Intel retbleed, which is an entirely different bug) is fundamentally the same as this SRSO -- which is also caused by STC. And the mitigations are so similar they should all be controlled from a single spot and not conflated like they are now.

As such, at the end of the ride the new kernel command line and srso sysfs files are no more and all we're left with is a few extra retbleed options.

Aside of that; this deals with a few implementation issues -- but not all known issues. Josh and Andrew are telling me there's a problem when running inside virt due to how this checks the microcode. I'm hoping either of those two gents will add a patch to address this.