kernel_optimize_test/arch/um
Peter Zijlstra 381fd04c97 x86/alternative: Implement .retpoline_sites support
commit 7508500900814d14e2e085cdc4e28142721abbdf upstream.

Rewrite retpoline thunk call sites to be indirect calls for
spectre_v2=off. This ensures spectre_v2=off is as near to a
RETPOLINE=n build as possible.

This is the replacement for objtool writing alternative entries to
ensure the same and achieves feature-parity with the previous
approach.

One noteworthy feature is that it relies on the thunks to be in
machine order to compute the register index.

Specifically, this does not yet address the Jcc __x86_indirect_thunk_*
calls generated by clang, a future patch will add this.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Borislav Petkov <bp@suse.de>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Tested-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/r/20211026120310.232495794@infradead.org
[cascardo: small conflict fixup at arch/x86/kernel/module.c]
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
[bwh: Backported to 5.10:
 - Use hex literal instead of BYTES_NOP1
 - Adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-25 11:26:26 +02:00
..
configs
drivers um: chan_user: Fix winch_tramp() return value 2022-06-09 10:21:26 +02:00
include ptrace/um: Replace PT_DTRACE with TIF_SINGLESTEP 2022-06-09 10:20:49 +02:00
kernel x86/alternative: Implement .retpoline_sites support 2022-07-25 11:26:26 +02:00
os-Linux um: registers: Rename function names to avoid conflicts and build problems 2022-01-27 10:54:18 +01:00
scripts
.gitignore
Kconfig Merge branch 'work.set_fs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2020-10-22 09:59:21 -07:00
Kconfig.debug um: Disable CONFIG_GCOV with MODULES 2021-05-22 11:40:53 +02:00
Makefile
Makefile-os-Linux
Makefile-skas