Skip to content

Commit 4402e36

Browse files
committed
tools headers: Update the copy of x86's memcpy_64.S used in 'perf bench'
We also need to add SYM_TYPED_FUNC_START() to util/include/linux/linkage.h and update tools/perf/check_headers.sh to ignore the include cfi_types.h line when checking if the kernel original files drifted from the copies we carry. This is to get the changes from: ccace93 ("x86: Add types to indirectly called assembly functions") Addressing these tools/perf build warnings: Warning: Kernel ABI header at 'tools/arch/x86/lib/memcpy_64.S' differs from latest version at 'arch/x86/lib/memcpy_64.S' diff -u tools/arch/x86/lib/memcpy_64.S arch/x86/lib/memcpy_64.S Cc: Adrian Hunter <[email protected]> Cc: Ian Rogers <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Kees Cook <[email protected]> Cc: Sami Tolvanen <[email protected]> Link: https://lore.kernel.org/lkml/[email protected]/ Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent ffc1df3 commit 4402e36

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

tools/arch/x86/lib/memcpy_64.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
* Output:
2828
* rax original destination
2929
*/
30-
SYM_FUNC_START(__memcpy)
30+
SYM_TYPED_FUNC_START(__memcpy)
3131
ALTERNATIVE_2 "jmp memcpy_orig", "", X86_FEATURE_REP_GOOD, \
3232
"jmp memcpy_erms", X86_FEATURE_ERMS
3333

tools/perf/check-headers.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ for i in $SYNC_CHECK_FILES; do
143143
done
144144

145145
# diff with extra ignore lines
146-
check arch/x86/lib/memcpy_64.S '-I "^EXPORT_SYMBOL" -I "^#include <asm/export.h>" -I"^SYM_FUNC_START\(_LOCAL\)*(memcpy_\(erms\|orig\))"'
146+
check arch/x86/lib/memcpy_64.S '-I "^EXPORT_SYMBOL" -I "^#include <asm/export.h>" -I"^SYM_FUNC_START\(_LOCAL\)*(memcpy_\(erms\|orig\))" -I"^#include <linux/cfi_types.h>"'
147147
check arch/x86/lib/memset_64.S '-I "^EXPORT_SYMBOL" -I "^#include <asm/export.h>" -I"^SYM_FUNC_START\(_LOCAL\)*(memset_\(erms\|orig\))"'
148148
check arch/x86/include/asm/amd-ibs.h '-I "^#include [<\"]\(asm/\)*msr-index.h"'
149149
check arch/arm64/include/asm/cputype.h '-I "^#include [<\"]\(asm/\)*sysreg.h"'

tools/perf/util/include/linux/linkage.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,17 @@
115115
SYM_ALIAS(alias, name, SYM_T_FUNC, SYM_L_WEAK)
116116
#endif
117117

118+
// In the kernel sources (include/linux/cfi_types.h), this has a different
119+
// definition when CONFIG_CFI_CLANG is used, for tools/ just use the !clang
120+
// definition:
121+
#ifndef SYM_TYPED_START
122+
#define SYM_TYPED_START(name, linkage, align...) \
123+
SYM_START(name, linkage, align)
124+
#endif
125+
126+
#ifndef SYM_TYPED_FUNC_START
127+
#define SYM_TYPED_FUNC_START(name) \
128+
SYM_TYPED_START(name, SYM_L_GLOBAL, SYM_A_ALIGN)
129+
#endif
130+
118131
#endif /* PERF_LINUX_LINKAGE_H_ */

0 commit comments

Comments
 (0)