linux/arch/s390
Vasily Gorbik 1d2ad08480 s390/nospec: add an option to use thunk-extern
Currently with -mindirect-branch=thunk and -mfunction-return=thunk compiler
options expoline thunks are put into individual COMDAT group sections. s390
is the only architecture which has group sections and it has implications
for kpatch and objtool tools support.

Using -mindirect-branch=thunk-extern and -mfunction-return=thunk-extern
is an alternative, which comes with a need to generate all required
expoline thunks manually. Unfortunately modules area is too far away from
the kernel image, and expolines from the kernel image cannon be used.
But since all new distributions (except Debian) build kernels for machine
generations newer than z10, where "exrl" instruction is available, that
leaves only 16 expolines thunks possible.

Provide an option to build the kernel with
-mindirect-branch=thunk-extern and -mfunction-return=thunk-extern for
z10 or newer. This also requires to postlink expoline thunks into all
modules explicitly. Currently modules already contain most expolines
anyhow.

Unfortunately -mindirect-branch=thunk-extern and
-mfunction-return=thunk-extern options support is broken in gcc <= 11.2.
Additional compile test is required to verify proper gcc support.

Acked-by: Ilya Leoshkevich <iii@linux.ibm.com>
Co-developed-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Signed-off-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
2022-03-10 15:58:17 +01:00
..
appldata s390/appldata: use struct_size() helper 2020-06-29 16:32:34 +02:00
boot s390: remove invalid email address of Heiko Carstens 2022-02-06 23:31:29 +01:00
configs s390: update defconfigs 2022-01-24 09:10:59 +01:00
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2022-01-11 10:21:35 -08:00
hypfs s390/extable: move EX_TABLE define to asm-extable.h 2022-03-08 00:33:00 +01:00
include s390/nospec: add an option to use thunk-extern 2022-03-10 15:58:17 +01:00
kernel s390: remove unused expoline to BC instructions 2022-03-08 00:33:01 +01:00
kvm s390: remove invalid email address of Heiko Carstens 2022-02-06 23:31:29 +01:00
lib s390/nospec: add an option to use thunk-extern 2022-03-10 15:58:17 +01:00
mm s390/extable: add dedicated uaccess handler 2022-03-08 00:33:00 +01:00
net s390/bpf: encode register within extable entry 2022-03-08 00:33:00 +01:00
pci s390/pci: make zpci_set_irq()/zpci_clear_irq() static 2022-03-10 15:58:17 +01:00
purgatory s390: enable KCSAN 2021-07-30 17:09:23 +02:00
tools s390/nospec: add an option to use thunk-extern 2022-03-10 15:58:17 +01:00
Kbuild kbuild: use more subdir- for visiting subdirectories while cleaning 2021-10-24 13:49:46 +09:00
Kconfig s390/nospec: add an option to use thunk-extern 2022-03-10 15:58:17 +01:00
Kconfig.debug tracing: Refactor TRACE_IRQFLAGS_SUPPORT in Kconfig 2021-08-16 11:37:21 -04:00
Makefile s390/nospec: add an option to use thunk-extern 2022-03-10 15:58:17 +01:00