aboutsummaryrefslogtreecommitdiff
path: root/arch/s390/lib/expoline.S
diff options
context:
space:
mode:
authorVasily Gorbik <[email protected]>2024-01-17 11:50:49 +0100
committerAlexander Gordeev <[email protected]>2024-04-17 13:38:03 +0200
commitba05b39d54eef78043b5c8ee90545cb06a98ae6f (patch)
tree418a03082771eedde694ef99a12334276b3e21d7 /arch/s390/lib/expoline.S
parentea84f14d2a6b1a4fde17d2713dbdfdef7b84da87 (diff)
s390/expoline: Make modules use kernel expolines
Currently, kernel modules contain their own set of expoline thunks. In the case of EXPOLINE_EXTERN, this involves postlinking of precompiled expoline.o. expoline.o is also necessary for out-of-source tree module builds. Now that the kernel modules area is less than 4 GB away from kernel expoline thunks, make modules use kernel expolines. Also make EXPOLINE_EXTERN the default if the compiler supports it. This simplifies build and aligns with the approach adopted by other architectures. Signed-off-by: Vasily Gorbik <[email protected]> Signed-off-by: Alexander Gordeev <[email protected]>
Diffstat (limited to 'arch/s390/lib/expoline.S')
-rw-r--r--arch/s390/lib/expoline.S12
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/s390/lib/expoline.S b/arch/s390/lib/expoline.S
new file mode 100644
index 000000000000..92ed8409a7a4
--- /dev/null
+++ b/arch/s390/lib/expoline.S
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+#include <asm/nospec-insn.h>
+#include <linux/linkage.h>
+
+.macro GEN_ALL_BR_THUNK_EXTERN
+ .irp r1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
+ GEN_BR_THUNK_EXTERN %r\r1
+ .endr
+.endm
+
+GEN_ALL_BR_THUNK_EXTERN