2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2025-01-23 22:25:40 +08:00

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>
This commit is contained in:
Vasily Gorbik 2022-03-06 22:30:42 +01:00
parent 1d2ad08480
commit 602bf1687e

View File

@ -20,6 +20,7 @@ _LC_BR_R1 = __LC_BR_R1
.macro __THUNK_PROLOG_NAME name
#ifdef CONFIG_EXPOLINE_EXTERN
.pushsection .text,"ax",@progbits
.align 16,0x07
#else
.pushsection .text.\name,"axG",@progbits,\name,comdat
#endif
@ -30,8 +31,11 @@ _LC_BR_R1 = __LC_BR_R1
CFI_STARTPROC
.endm
.macro __THUNK_EPILOG
.macro __THUNK_EPILOG_NAME name
CFI_ENDPROC
#ifdef CONFIG_EXPOLINE_EXTERN
.size \name, .-\name
#endif
.popsection
.endm
@ -40,6 +44,10 @@ _LC_BR_R1 = __LC_BR_R1
__THUNK_PROLOG_NAME __s390_indirect_jump_r\r1
.endm
.macro __THUNK_EPILOG_BR r1,r2
__THUNK_EPILOG_NAME __s390_indirect_jump_r\r1
.endm
.macro __THUNK_BR r1,r2
jg __s390_indirect_jump_r\r1
.endm
@ -52,6 +60,10 @@ _LC_BR_R1 = __LC_BR_R1
__THUNK_PROLOG_NAME __s390_indirect_jump_r\r2\()use_r\r1
.endm
.macro __THUNK_EPILOG_BR r1,r2
__THUNK_EPILOG_NAME __s390_indirect_jump_r\r2\()use_r\r1
.endm
.macro __THUNK_BR r1,r2
jg __s390_indirect_jump_r\r2\()use_r\r1
.endm
@ -128,7 +140,7 @@ _LC_BR_R1 = __LC_BR_R1
#endif
__DECODE_RR __THUNK_PROLOG_BR,\reg,\ruse
__THUNK_EX_BR \reg,\ruse
__THUNK_EPILOG
__DECODE_RR __THUNK_EPILOG_BR,\reg,\ruse
.endm
.macro BR_EX reg,ruse=%r1