[PATCH 0/4] x86/srso: Reduce overhead of the mitigation

From: Andrew Cooper
Date: Mon Aug 21 2023 - 07:27:38 EST


The main point of this series is patch 4 to remove one taken branch from every
function return. Everything else is cleanup.

Patch 3 has an issue that sadly may invalidate this as a technique. Patch 4
needs some objtool whispering to fix.

Based on x86/urgent but I suspect this may want rebasing around other fixes in
flight.

Andrew Cooper (4):
x86/srso: Rename srso_alias_*() to srso_fam19_*()
x86/srso: Rename fam17 SRSO infrastructure to srso_fam17_*()
x86/ret-thunk: Support CALL-ing to the ret-thunk
x86/srso: Use CALL-based return thunks to reduce overhead

arch/x86/include/asm/nospec-branch.h | 9 ++--
arch/x86/kernel/alternative.c | 4 +-
arch/x86/kernel/cpu/bugs.c | 9 ++--
arch/x86/kernel/ftrace.c | 8 +--
arch/x86/kernel/static_call.c | 10 ++--
arch/x86/kernel/vmlinux.lds.S | 10 ++--
arch/x86/lib/retpoline.S | 75 ++++++++++++----------------
arch/x86/net/bpf_jit_comp.c | 5 +-
8 files changed, 67 insertions(+), 63 deletions(-)


base-commit: 6405b72e8d17bd1875a56ae52d23ec3cd51b9d66
--
2.30.2