tree: https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git bpf/tracing_multi_ng_7 head: c35e21f7c5e98d9c2a5056305f17127e05b6c209 commit: 02d56590e262047425559f07cf0da8137d13dbda [15/30] bpf: Replace bpf_tramp_links with bpf_tramp_progs config: arm64-allyesconfig compiler: aarch64-linux-gcc (GCC) 12.1.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git/commit/?id=02d56590e262047425559f07cf0da8137d13dbda git remote add jolsa-perf https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git git fetch --no-tags jolsa-perf bpf/tracing_multi_ng_7 git checkout 02d56590e262047425559f07cf0da8137d13dbda # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash arch/arm64/net/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot All warnings (new ones prefixed by >>): >> arch/arm64/net/bpf_jit_comp.c:1709:60: warning: 'struct bpf_tramp_links' declared inside parameter list will not be visible outside of this definition or declaration 1709 | static void invoke_bpf_mod_ret(struct jit_ctx *ctx, struct bpf_tramp_links *tl, | ^~~~~~~~~~~~~~~ arch/arm64/net/bpf_jit_comp.c: In function 'invoke_bpf_mod_ret': arch/arm64/net/bpf_jit_comp.c:1719:27: error: invalid use of undefined type 'struct bpf_tramp_links' 1719 | for (i = 0; i < tl->nr_links; i++) { | ^~ arch/arm64/net/bpf_jit_comp.c:1720:40: error: invalid use of undefined type 'struct bpf_tramp_links' 1720 | invoke_bpf_prog(ctx, tl->links[i], args_off, retval_off, | ^~ arch/arm64/net/bpf_jit_comp.c: At top level: arch/arm64/net/bpf_jit_comp.c:1766:38: warning: 'struct bpf_tramp_links' declared inside parameter list will not be visible outside of this definition or declaration 1766 | struct bpf_tramp_links *tlinks, void *orig_call, | ^~~~~~~~~~~~~~~ arch/arm64/net/bpf_jit_comp.c: In function 'prepare_trampoline': arch/arm64/net/bpf_jit_comp.c:1778:49: error: invalid use of undefined type 'struct bpf_tramp_links' 1778 | struct bpf_tramp_links *fentry = &tlinks[BPF_TRAMP_FENTRY]; | ^ arch/arm64/net/bpf_jit_comp.c:1779:48: error: invalid use of undefined type 'struct bpf_tramp_links' 1779 | struct bpf_tramp_links *fexit = &tlinks[BPF_TRAMP_FEXIT]; | ^ arch/arm64/net/bpf_jit_comp.c:1780:51: error: invalid use of undefined type 'struct bpf_tramp_links' 1780 | struct bpf_tramp_links *fmod_ret = &tlinks[BPF_TRAMP_MODIFY_RETURN]; | ^ arch/arm64/net/bpf_jit_comp.c:1884:31: error: invalid use of undefined type 'struct bpf_tramp_links' 1884 | for (i = 0; i < fentry->nr_links; i++) | ^~ arch/arm64/net/bpf_jit_comp.c:1885:44: error: invalid use of undefined type 'struct bpf_tramp_links' 1885 | invoke_bpf_prog(ctx, fentry->links[i], args_off, | ^~ arch/arm64/net/bpf_jit_comp.c:1889:21: error: invalid use of undefined type 'struct bpf_tramp_links' 1889 | if (fmod_ret->nr_links) { | ^~ arch/arm64/net/bpf_jit_comp.c:1890:44: error: invalid use of undefined type 'struct bpf_tramp_links' 1890 | branches = kcalloc(fmod_ret->nr_links, sizeof(__le32 *), | ^~ arch/arm64/net/bpf_jit_comp.c:1895:41: error: passing argument 2 of 'invoke_bpf_mod_ret' from incompatible pointer type [-Werror=incompatible-pointer-types] 1895 | invoke_bpf_mod_ret(ctx, fmod_ret, args_off, retval_off, | ^~~~~~~~ | | | struct bpf_tramp_links * arch/arm64/net/bpf_jit_comp.c:1709:77: note: expected 'struct bpf_tramp_links *' but argument is of type 'struct bpf_tramp_links *' 1709 | static void invoke_bpf_mod_ret(struct jit_ctx *ctx, struct bpf_tramp_links *tl, | ~~~~~~~~~~~~~~~~~~~~~~~~^~ arch/arm64/net/bpf_jit_comp.c:1912:33: error: invalid use of undefined type 'struct bpf_tramp_links' 1912 | for (i = 0; i < fmod_ret->nr_links && ctx->image != NULL; i++) { | ^~ arch/arm64/net/bpf_jit_comp.c:1917:30: error: invalid use of undefined type 'struct bpf_tramp_links' 1917 | for (i = 0; i < fexit->nr_links; i++) | ^~ arch/arm64/net/bpf_jit_comp.c:1918:43: error: invalid use of undefined type 'struct bpf_tramp_links' 1918 | invoke_bpf_prog(ctx, fexit->links[i], args_off, retval_off, | ^~ arch/arm64/net/bpf_jit_comp.c: At top level: arch/arm64/net/bpf_jit_comp.c:1965:51: warning: 'struct bpf_tramp_links' declared inside parameter list will not be visible outside of this definition or declaration 1965 | u32 flags, struct bpf_tramp_links *tlinks, | ^~~~~~~~~~~~~~~ arch/arm64/net/bpf_jit_comp.c:1963:5: error: conflicting types for 'arch_prepare_bpf_trampoline'; have 'int(struct bpf_tramp_image *, void *, void *, const struct btf_func_model *, u32, struct bpf_tramp_links *, void *)' {aka 'int(struct bpf_tramp_image *, void *, void *, const struct btf_func_model *, unsigned int, struct bpf_tramp_links *, void *)'} 1963 | int arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *image, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from arch/arm64/net/bpf_jit_comp.c:11: include/linux/bpf.h:977:5: note: previous declaration of 'arch_prepare_bpf_trampoline' with type 'int(struct bpf_tramp_image *, void *, void *, const struct btf_func_model *, u32, struct bpf_tramp_progs *, void *)' {aka 'int(struct bpf_tramp_image *, void *, void *, const struct btf_func_model *, unsigned int, struct bpf_tramp_progs *, void *)'} 977 | int arch_prepare_bpf_trampoline(struct bpf_tramp_image *tr, void *image, void *image_end, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/arm64/net/bpf_jit_comp.c: In function 'arch_prepare_bpf_trampoline': arch/arm64/net/bpf_jit_comp.c:1986:44: error: passing argument 3 of 'prepare_trampoline' from incompatible pointer type [-Werror=incompatible-pointer-types] 1986 | ret = prepare_trampoline(&ctx, im, tlinks, orig_call, nargs, flags); | ^~~~~~ | | | struct bpf_tramp_links * arch/arm64/net/bpf_jit_comp.c:1766:55: note: expected 'struct bpf_tramp_links *' but argument is of type 'struct bpf_tramp_links *' 1766 | struct bpf_tramp_links *tlinks, void *orig_call, | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~ arch/arm64/net/bpf_jit_comp.c:1997:44: error: passing argument 3 of 'prepare_trampoline' from incompatible pointer type [-Werror=incompatible-pointer-types] 1997 | ret = prepare_trampoline(&ctx, im, tlinks, orig_call, nargs, flags); | ^~~~~~ | | | struct bpf_tramp_links * arch/arm64/net/bpf_jit_comp.c:1766:55: note: expected 'struct bpf_tramp_links *' but argument is of type 'struct bpf_tramp_links *' 1766 | struct bpf_tramp_links *tlinks, void *orig_call, | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~ cc1: some warnings being treated as errors vim +1709 arch/arm64/net/bpf_jit_comp.c efc9909fdce00a Xu Kuohai 2022-07-11 1708 efc9909fdce00a Xu Kuohai 2022-07-11 @1709 static void invoke_bpf_mod_ret(struct jit_ctx *ctx, struct bpf_tramp_links *tl, efc9909fdce00a Xu Kuohai 2022-07-11 1710 int args_off, int retval_off, int run_ctx_off, aada476655461a Xu Kuohai 2022-08-08 1711 __le32 **branches) efc9909fdce00a Xu Kuohai 2022-07-11 1712 { efc9909fdce00a Xu Kuohai 2022-07-11 1713 int i; efc9909fdce00a Xu Kuohai 2022-07-11 1714 efc9909fdce00a Xu Kuohai 2022-07-11 1715 /* The first fmod_ret program will receive a garbage return value. efc9909fdce00a Xu Kuohai 2022-07-11 1716 * Set this to 0 to avoid confusing the program. efc9909fdce00a Xu Kuohai 2022-07-11 1717 */ efc9909fdce00a Xu Kuohai 2022-07-11 1718 emit(A64_STR64I(A64_ZR, A64_SP, retval_off), ctx); efc9909fdce00a Xu Kuohai 2022-07-11 1719 for (i = 0; i < tl->nr_links; i++) { efc9909fdce00a Xu Kuohai 2022-07-11 1720 invoke_bpf_prog(ctx, tl->links[i], args_off, retval_off, efc9909fdce00a Xu Kuohai 2022-07-11 1721 run_ctx_off, true); efc9909fdce00a Xu Kuohai 2022-07-11 1722 /* if (*(u64 *)(sp + retval_off) != 0) efc9909fdce00a Xu Kuohai 2022-07-11 1723 * goto do_fexit; efc9909fdce00a Xu Kuohai 2022-07-11 1724 */ efc9909fdce00a Xu Kuohai 2022-07-11 1725 emit(A64_LDR64I(A64_R(10), A64_SP, retval_off), ctx); efc9909fdce00a Xu Kuohai 2022-07-11 1726 /* Save the location of branch, and generate a nop. efc9909fdce00a Xu Kuohai 2022-07-11 1727 * This nop will be replaced with a cbnz later. efc9909fdce00a Xu Kuohai 2022-07-11 1728 */ efc9909fdce00a Xu Kuohai 2022-07-11 1729 branches[i] = ctx->image + ctx->idx; efc9909fdce00a Xu Kuohai 2022-07-11 1730 emit(A64_NOP, ctx); efc9909fdce00a Xu Kuohai 2022-07-11 1731 } efc9909fdce00a Xu Kuohai 2022-07-11 1732 } efc9909fdce00a Xu Kuohai 2022-07-11 1733 :::::: The code at line 1709 was first introduced by commit :::::: efc9909fdce00a827a37609628223cd45bf95d0b bpf, arm64: Add bpf trampoline for arm64 :::::: TO: Xu Kuohai :::::: CC: Daniel Borkmann -- 0-DAY CI Kernel Test Service https://01.org/lkp