aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorVasily Gorbik2022-02-28 13:15:59 +0100
committerVasily Gorbik2022-03-10 15:58:17 +0100
commiteed38cd2f46f6c4f97c730abd8f23a19db0afbc8 (patch)
tree04e860d466ae873384a96f28ee51fbc341fa4d2c /arch
parent6c2797cd51218a451a52edc2ca533f89d1a2af10 (diff)
s390/nospec: generate single register thunks if possible
Currently assembler generated expoline thunks are always in a form __s390_indirect_jump_rXuse_rX even when exrl instruction is available and no additional register is utilized. Generate __s390_indirect_jump_rX versions using a single register if the kernel is built for z10 or newer machine, which have exrl instruction available. Thunks generated are identical to the ones generated by the compiler. This helps to reduce the number of thunks for newer machines generations. Acked-by: Sumanth Korikkar <sumanthk@linux.ibm.com> Acked-by: Ilya Leoshkevich <iii@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/s390/include/asm/nospec-insn.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/s390/include/asm/nospec-insn.h b/arch/s390/include/asm/nospec-insn.h
index c419c9e87265..4397eae15e34 100644
--- a/arch/s390/include/asm/nospec-insn.h
+++ b/arch/s390/include/asm/nospec-insn.h
@@ -31,6 +31,19 @@ _LC_BR_R1 = __LC_BR_R1
.popsection
.endm
+#ifdef CONFIG_HAVE_MARCH_Z10_FEATURES
+ .macro __THUNK_PROLOG_BR r1,r2
+ __THUNK_PROLOG_NAME __s390_indirect_jump_r\r1
+ .endm
+
+ .macro __THUNK_BR r1,r2
+ jg __s390_indirect_jump_r\r1
+ .endm
+
+ .macro __THUNK_BRASL r1,r2,r3
+ brasl \r1,__s390_indirect_jump_r\r2
+ .endm
+#else
.macro __THUNK_PROLOG_BR r1,r2
__THUNK_PROLOG_NAME __s390_indirect_jump_r\r2\()use_r\r1
.endm
@@ -42,6 +55,7 @@ _LC_BR_R1 = __LC_BR_R1
.macro __THUNK_BRASL r1,r2,r3
brasl \r1,__s390_indirect_jump_r\r3\()use_r\r2
.endm
+#endif
.macro __DECODE_RR expand,reg,ruse
.set __decode_fail,1