Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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:

ccace936eec7b805 ("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 <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Kees Cook <keescook@chromium.org>
Cc: Sami Tolvanen <samitolvanen@google.com>
Link: https://lore.kernel.org/lkml/Y1f3VRIec9EBgX6F@kernel.org/
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

+15 -2
+1 -1
tools/arch/x86/lib/memcpy_64.S
··· 27 27 * Output: 28 28 * rax original destination 29 29 */ 30 - SYM_FUNC_START(__memcpy) 30 + SYM_TYPED_FUNC_START(__memcpy) 31 31 ALTERNATIVE_2 "jmp memcpy_orig", "", X86_FEATURE_REP_GOOD, \ 32 32 "jmp memcpy_erms", X86_FEATURE_ERMS 33 33
+1 -1
tools/perf/check-headers.sh
··· 143 143 done 144 144 145 145 # 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>"' 147 147 check arch/x86/lib/memset_64.S '-I "^EXPORT_SYMBOL" -I "^#include <asm/export.h>" -I"^SYM_FUNC_START\(_LOCAL\)*(memset_\(erms\|orig\))"' 148 148 check arch/x86/include/asm/amd-ibs.h '-I "^#include [<\"]\(asm/\)*msr-index.h"' 149 149 check arch/arm64/include/asm/cputype.h '-I "^#include [<\"]\(asm/\)*sysreg.h"'
+13
tools/perf/util/include/linux/linkage.h
··· 115 115 SYM_ALIAS(alias, name, SYM_T_FUNC, SYM_L_WEAK) 116 116 #endif 117 117 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 + 118 131 #endif /* PERF_LINUX_LINKAGE_H_ */