Skip to content

Commit eed38cd

Browse files
author
Vasily Gorbik
committed
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>
1 parent 6c2797c commit eed38cd

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

arch/s390/include/asm/nospec-insn.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,19 @@ _LC_BR_R1 = __LC_BR_R1
3131
.popsection
3232
.endm
3333

34+
#ifdef CONFIG_HAVE_MARCH_Z10_FEATURES
35+
.macro __THUNK_PROLOG_BR r1,r2
36+
__THUNK_PROLOG_NAME __s390_indirect_jump_r\r1
37+
.endm
38+
39+
.macro __THUNK_BR r1,r2
40+
jg __s390_indirect_jump_r\r1
41+
.endm
42+
43+
.macro __THUNK_BRASL r1,r2,r3
44+
brasl \r1,__s390_indirect_jump_r\r2
45+
.endm
46+
#else
3447
.macro __THUNK_PROLOG_BR r1,r2
3548
__THUNK_PROLOG_NAME __s390_indirect_jump_r\r2\()use_r\r1
3649
.endm
@@ -42,6 +55,7 @@ _LC_BR_R1 = __LC_BR_R1
4255
.macro __THUNK_BRASL r1,r2,r3
4356
brasl \r1,__s390_indirect_jump_r\r3\()use_r\r2
4457
.endm
58+
#endif
4559

4660
.macro __DECODE_RR expand,reg,ruse
4761
.set __decode_fail,1

0 commit comments

Comments
 (0)