Skip to content

Commit 602bf16

Browse files
author
Vasily Gorbik
committed
s390/nospec: align and size extern thunks
Kernel has full control over how extern thunks generated by arch/s390/lib/expoline.S look like. Align them to 16 bytes like other symbols. Also set proper symbols size which is important for tooling. Acked-by: Ilya Leoshkevich <iii@linux.ibm.com> Acked-by: Sumanth Korikkar <sumanthk@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
1 parent 1d2ad08 commit 602bf16

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

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

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ _LC_BR_R1 = __LC_BR_R1
2020
.macro __THUNK_PROLOG_NAME name
2121
#ifdef CONFIG_EXPOLINE_EXTERN
2222
.pushsection .text,"ax",@progbits
23+
.align 16,0x07
2324
#else
2425
.pushsection .text.\name,"axG",@progbits,\name,comdat
2526
#endif
@@ -30,8 +31,11 @@ _LC_BR_R1 = __LC_BR_R1
3031
CFI_STARTPROC
3132
.endm
3233

33-
.macro __THUNK_EPILOG
34+
.macro __THUNK_EPILOG_NAME name
3435
CFI_ENDPROC
36+
#ifdef CONFIG_EXPOLINE_EXTERN
37+
.size \name, .-\name
38+
#endif
3539
.popsection
3640
.endm
3741

@@ -40,6 +44,10 @@ _LC_BR_R1 = __LC_BR_R1
4044
__THUNK_PROLOG_NAME __s390_indirect_jump_r\r1
4145
.endm
4246

47+
.macro __THUNK_EPILOG_BR r1,r2
48+
__THUNK_EPILOG_NAME __s390_indirect_jump_r\r1
49+
.endm
50+
4351
.macro __THUNK_BR r1,r2
4452
jg __s390_indirect_jump_r\r1
4553
.endm
@@ -52,6 +60,10 @@ _LC_BR_R1 = __LC_BR_R1
5260
__THUNK_PROLOG_NAME __s390_indirect_jump_r\r2\()use_r\r1
5361
.endm
5462

63+
.macro __THUNK_EPILOG_BR r1,r2
64+
__THUNK_EPILOG_NAME __s390_indirect_jump_r\r2\()use_r\r1
65+
.endm
66+
5567
.macro __THUNK_BR r1,r2
5668
jg __s390_indirect_jump_r\r2\()use_r\r1
5769
.endm
@@ -128,7 +140,7 @@ _LC_BR_R1 = __LC_BR_R1
128140
#endif
129141
__DECODE_RR __THUNK_PROLOG_BR,\reg,\ruse
130142
__THUNK_EX_BR \reg,\ruse
131-
__THUNK_EPILOG
143+
__DECODE_RR __THUNK_EPILOG_BR,\reg,\ruse
132144
.endm
133145

134146
.macro BR_EX reg,ruse=%r1

0 commit comments

Comments
 (0)