Skip to content

Commit b1f7810

Browse files
committed
x86: Add missing code to arch/x86/include/asm/linkage.h
JIRA: https://issues.redhat.com/browse/RHEL-68940 Upstream Status: RHEL only The RHEL 9's arch/x86/include/asm/linkage.h file have all the upstream patches applied as of v6.12. However, some code change is skipped during the backport of commit bea75b3 ("x86/Kconfig: Introduce function padding"). As all the dependent pieces are present, add back the missing code to make it the same as the v6.12 version. Signed-off-by: Waiman Long <longman@redhat.com>
1 parent 024dac6 commit b1f7810

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

arch/x86/include/asm/linkage.h

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,45 @@
6464

6565
#endif /* __ASSEMBLY__ */
6666

67+
/*
68+
* Depending on -fpatchable-function-entry=N,N usage (CONFIG_CALL_PADDING) the
69+
* CFI symbol layout changes.
70+
*
71+
* Without CALL_THUNKS:
72+
*
73+
* .align FUNCTION_ALIGNMENT
74+
* __cfi_##name:
75+
* .skip FUNCTION_PADDING, 0x90
76+
* .byte 0xb8
77+
* .long __kcfi_typeid_##name
78+
* name:
79+
*
80+
* With CALL_THUNKS:
81+
*
82+
* .align FUNCTION_ALIGNMENT
83+
* __cfi_##name:
84+
* .byte 0xb8
85+
* .long __kcfi_typeid_##name
86+
* .skip FUNCTION_PADDING, 0x90
87+
* name:
88+
*
89+
* In both cases the whole thing is FUNCTION_ALIGNMENT aligned and sized.
90+
*/
91+
92+
#ifdef CONFIG_CALL_PADDING
93+
#define CFI_PRE_PADDING
94+
#define CFI_POST_PADDING .skip CONFIG_FUNCTION_PADDING_BYTES, 0x90;
95+
#else
96+
#define CFI_PRE_PADDING .skip CONFIG_FUNCTION_PADDING_BYTES, 0x90;
97+
#define CFI_POST_PADDING
98+
#endif
99+
67100
#define __CFI_TYPE(name) \
68101
SYM_START(__cfi_##name, SYM_L_LOCAL, SYM_A_NONE) \
69-
.fill 11, 1, 0x90 ASM_NL \
102+
CFI_PRE_PADDING \
70103
.byte 0xb8 ASM_NL \
71104
.long __kcfi_typeid_##name ASM_NL \
105+
CFI_POST_PADDING \
72106
SYM_FUNC_END(__cfi_##name)
73107

74108
/* UML needs to be able to override memcpy() and friends for KASAN. */

0 commit comments

Comments
 (0)