Hi "Toke,
I love your patch! Yet something to improve:
[auto build test ERROR on bpf-next/master]
url:
https://github.com/0day-ci/linux/commits/Toke-H-iland-J-rgensen/bpf-Suppo...
base:
https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
config: xtensa-allyesconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 9.3.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
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=xtensa
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from include/linux/bpf-cgroup.h:5,
from include/linux/cgroup-defs.h:22,
from include/linux/cgroup.h:28,
from kernel/fork.c:49:
> include/linux/bpf.h:677:15: error: unknown type name
'bpf_trampoline'
677 | static inline bpf_trampoline
*bpf_trampoline_get(u64 key, void *addr,
| ^~~~~~~~~~~~~~
kernel/fork.c:160:13: warning: no previous prototype for
'arch_release_task_struct' [-Wmissing-prototypes]
160 | void __weak arch_release_task_struct(struct task_struct *tsk)
| ^~~~~~~~~~~~~~~~~~~~~~~~
kernel/fork.c:743:20: warning: no previous prototype for 'arch_task_cache_init'
[-Wmissing-prototypes]
743 | void __init __weak arch_task_cache_init(void) { }
| ^~~~~~~~~~~~~~~~~~~~
kernel/fork.c:834:12: warning: no previous prototype for 'arch_dup_task_struct'
[-Wmissing-prototypes]
834 | int __weak arch_dup_task_struct(struct task_struct *dst,
| ^~~~~~~~~~~~~~~~~~~~
--
In file included from include/linux/bpf-cgroup.h:5,
from include/linux/cgroup-defs.h:22,
from include/linux/cgroup.h:28,
from include/linux/perf_event.h:57,
from include/linux/trace_events.h:10,
from include/trace/syscall.h:7,
from include/linux/syscalls.h:84,
from kernel/exec_domain.c:19:
> include/linux/bpf.h:677:15: error: unknown type name
'bpf_trampoline'
677 | static inline bpf_trampoline
*bpf_trampoline_get(u64 key, void *addr,
| ^~~~~~~~~~~~~~
--
In file included from include/linux/bpf-cgroup.h:5,
from include/linux/cgroup-defs.h:22,
from include/linux/cgroup.h:28,
from kernel/exit.c:41:
> include/linux/bpf.h:677:15: error: unknown type name
'bpf_trampoline'
677 | static inline bpf_trampoline
*bpf_trampoline_get(u64 key, void *addr,
| ^~~~~~~~~~~~~~
kernel/exit.c:1754:13: warning: no previous prototype for 'abort'
[-Wmissing-prototypes]
1754 | __weak void abort(void)
| ^~~~~
--
In file included from include/linux/bpf-cgroup.h:5,
from include/linux/cgroup-defs.h:22,
from include/linux/cgroup.h:28,
from include/net/netprio_cgroup.h:11,
from include/linux/netdevice.h:42,
from include/linux/if_vlan.h:10,
from include/linux/filter.h:21,
from kernel/kallsyms.c:25:
> include/linux/bpf.h:677:15: error: unknown type name
'bpf_trampoline'
677 | static inline bpf_trampoline
*bpf_trampoline_get(u64 key, void *addr,
| ^~~~~~~~~~~~~~
kernel/kallsyms.c:451:12: warning: no previous prototype for 'arch_get_kallsym'
[-Wmissing-prototypes]
451 | int __weak arch_get_kallsym(unsigned int symnum, unsigned long *value,
| ^~~~~~~~~~~~~~~~
--
In file included from include/linux/bpf-cgroup.h:5,
from include/linux/cgroup-defs.h:22,
from include/linux/cgroup.h:28,
from include/linux/perf_event.h:57,
from include/linux/trace_events.h:10,
from include/trace/syscall.h:7,
from include/linux/syscalls.h:84,
from kernel/audit.c:44:
> include/linux/bpf.h:677:15: error: unknown type name
'bpf_trampoline'
677 | static inline bpf_trampoline
*bpf_trampoline_get(u64 key, void *addr,
| ^~~~~~~~~~~~~~
kernel/audit.c: In function 'audit_log_vformat':
kernel/audit.c:1924:2: warning: function 'audit_log_vformat' might be a
candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
1924 | len = vsnprintf(skb_tail_pointer(skb), avail, fmt, args);
| ^~~
kernel/audit.c:1933:3: warning: function 'audit_log_vformat' might be a
candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
1933 | len = vsnprintf(skb_tail_pointer(skb), avail, fmt, args2);
| ^~~
--
In file included from include/linux/bpf-cgroup.h:5,
from include/linux/cgroup-defs.h:22,
from include/linux/cgroup.h:28,
from include/linux/perf_event.h:57,
from include/linux/hw_breakpoint.h:5,
from kernel/trace/trace.h:15,
from kernel/trace/trace_output.h:6,
from kernel/trace/ftrace.c:45:
> include/linux/bpf.h:677:15: error: unknown type name
'bpf_trampoline'
677 | static inline bpf_trampoline
*bpf_trampoline_get(u64 key, void *addr,
| ^~~~~~~~~~~~~~
kernel/trace/ftrace.c: In function 'ftrace_ops_get_list_func':
kernel/trace/ftrace.c:128:31: warning: cast between incompatible function types from
'void (*)(long unsigned int, long unsigned int)' to 'void (*)(long unsigned
int, long unsigned int, struct ftrace_ops *, struct pt_regs *)'
[-Wcast-function-type]
128 | #define ftrace_ops_list_func ((ftrace_func_t)ftrace_ops_no_ops)
| ^
kernel/trace/ftrace.c:174:10: note: in expansion of macro
'ftrace_ops_list_func'
174 | return ftrace_ops_list_func;
| ^~~~~~~~~~~~~~~~~~~~
kernel/trace/ftrace.c: In function 'update_ftrace_function':
kernel/trace/ftrace.c:128:31: warning: cast between incompatible function types from
'void (*)(long unsigned int, long unsigned int)' to 'void (*)(long unsigned
int, long unsigned int, struct ftrace_ops *, struct pt_regs *)'
[-Wcast-function-type]
128 | #define ftrace_ops_list_func ((ftrace_func_t)ftrace_ops_no_ops)
| ^
kernel/trace/ftrace.c:207:10: note: in expansion of macro
'ftrace_ops_list_func'
207 | func = ftrace_ops_list_func;
| ^~~~~~~~~~~~~~~~~~~~
kernel/trace/ftrace.c:128:31: warning: cast between incompatible function types from
'void (*)(long unsigned int, long unsigned int)' to 'void (*)(long unsigned
int, long unsigned int, struct ftrace_ops *, struct pt_regs *)'
[-Wcast-function-type]
128 | #define ftrace_ops_list_func ((ftrace_func_t)ftrace_ops_no_ops)
| ^
kernel/trace/ftrace.c:220:14: note: in expansion of macro
'ftrace_ops_list_func'
220 | if (func == ftrace_ops_list_func) {
| ^~~~~~~~~~~~~~~~~~~~
kernel/trace/ftrace.c:128:31: warning: cast between incompatible function types from
'void (*)(long unsigned int, long unsigned int)' to 'void (*)(long unsigned
int, long unsigned int, struct ftrace_ops *, struct pt_regs *)'
[-Wcast-function-type]
128 | #define ftrace_ops_list_func ((ftrace_func_t)ftrace_ops_no_ops)
| ^
kernel/trace/ftrace.c:240:26: note: in expansion of macro
'ftrace_ops_list_func'
240 | ftrace_trace_function = ftrace_ops_list_func;
| ^~~~~~~~~~~~~~~~~~~~
kernel/trace/ftrace.c: At top level:
kernel/trace/ftrace.c:584:5: warning: no previous prototype for
'ftrace_profile_pages_init' [-Wmissing-prototypes]
584 | int ftrace_profile_pages_init(struct ftrace_profile_stat *stat)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
--
In file included from include/linux/bpf-cgroup.h:5,
from include/linux/cgroup-defs.h:22,
from include/linux/cgroup.h:28,
from include/linux/blk-cgroup.h:17,
from include/linux/writeback.h:14,
from kernel/trace/trace.c:18:
> include/linux/bpf.h:677:15: error: unknown type name
'bpf_trampoline'
677 | static inline bpf_trampoline
*bpf_trampoline_get(u64 key, void *addr,
| ^~~~~~~~~~~~~~
In file included from kernel/trace/trace.c:8103:
kernel/trace/trace_selftest.c: In function 'trace_selftest_function_regs':
kernel/trace/trace_selftest.c:567:6: warning: variable 'len' set but not used
[-Wunused-but-set-variable]
567 | int len;
| ^~~
--
In file included from include/linux/bpf-cgroup.h:5,
from include/linux/cgroup-defs.h:22,
from include/linux/cgroup.h:28,
from include/linux/perf_event.h:57,
from include/linux/hw_breakpoint.h:5,
from kernel/trace/trace.h:15,
from kernel/trace/trace_output.h:6,
from kernel/trace/trace_output.c:14:
> include/linux/bpf.h:677:15: error: unknown type name
'bpf_trampoline'
677 | static inline bpf_trampoline
*bpf_trampoline_get(u64 key, void *addr,
| ^~~~~~~~~~~~~~
kernel/trace/trace_output.c: In function 'trace_output_raw':
kernel/trace/trace_output.c:321:2: warning: function 'trace_output_raw' might
be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
321 | trace_seq_vprintf(s, fmt, ap);
| ^~~~~~~~~~~~~~~~~
--
In file included from include/linux/bpf-cgroup.h:5,
from include/linux/cgroup-defs.h:22,
from include/linux/cgroup.h:28,
from include/linux/perf_event.h:57,
from include/linux/hw_breakpoint.h:5,
from kernel/trace/trace.h:15,
from kernel/trace/trace_preemptirq.c:13:
> include/linux/bpf.h:677:15: error: unknown type name
'bpf_trampoline'
677 | static inline bpf_trampoline
*bpf_trampoline_get(u64 key, void *addr,
| ^~~~~~~~~~~~~~
kernel/trace/trace_preemptirq.c:88:16: warning: no previous prototype for
'trace_hardirqs_on_caller' [-Wmissing-prototypes]
88 | __visible void trace_hardirqs_on_caller(unsigned long caller_addr)
| ^~~~~~~~~~~~~~~~~~~~~~~~
kernel/trace/trace_preemptirq.c:103:16: warning: no previous prototype for
'trace_hardirqs_off_caller' [-Wmissing-prototypes]
103 | __visible void trace_hardirqs_off_caller(unsigned long caller_addr)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
--
In file included from include/linux/bpf-cgroup.h:5,
from include/linux/cgroup-defs.h:22,
from include/linux/cgroup.h:28,
from include/net/netprio_cgroup.h:11,
from include/linux/netdevice.h:42,
from include/linux/if_vlan.h:10,
from include/linux/filter.h:21,
from kernel/bpf/core.c:21:
> include/linux/bpf.h:677:15: error: unknown type name
'bpf_trampoline'
677 | static inline bpf_trampoline
*bpf_trampoline_get(u64 key, void *addr,
| ^~~~~~~~~~~~~~
kernel/bpf/core.c:1353:12: warning: no previous prototype for
'bpf_probe_read_kernel' [-Wmissing-prototypes]
1353 | u64 __weak bpf_probe_read_kernel(void *dst, u32 size, const void *unsafe_ptr)
| ^~~~~~~~~~~~~~~~~~~~~
In file included from kernel/bpf/core.c:21:
kernel/bpf/core.c: In function '___bpf_prog_run':
include/linux/filter.h:879:3: warning: cast between incompatible function types from
'u64 (*)(u64, u64, u64, u64, u64)' {aka 'long long unsigned int (*)(long
long unsigned int, long long unsigned int, long long unsigned int, long long unsigned
int, long long unsigned int)'} to 'u64 (*)(u64, u64, u64, u64, u64, const
struct bpf_insn *)' {aka 'long long unsigned int (*)(long long unsigned int, long
long unsigned int, long long unsigned int, long long unsigned int, long long unsigned
int, const struct bpf_insn *)'} [-Wcast-function-type]
879 | ((u64 (*)(u64, u64, u64, u64, u64, const struct bpf_insn *)) \
| ^
kernel/bpf/core.c:1521:13: note: in expansion of macro '__bpf_call_base_args'
1521 | BPF_R0 = (__bpf_call_base_args + insn->imm)(BPF_R1, BPF_R2,
| ^~~~~~~~~~~~~~~~~~~~
kernel/bpf/core.c: In function 'bpf_patch_call_args':
include/linux/filter.h:879:3: warning: cast between incompatible function types from
'u64 (*)(u64, u64, u64, u64, u64)' {aka 'long long unsigned int (*)(long
long unsigned int, long long unsigned int, long long unsigned int, long long unsigned
int, long long unsigned int)'} to 'u64 (*)(u64, u64, u64, u64, u64, const
struct bpf_insn *)' {aka 'long long unsigned int (*)(long long unsigned int, long
long unsigned int, long long unsigned int, long long unsigned int, long long unsigned
int, const struct bpf_insn *)'} [-Wcast-function-type]
879 | ((u64 (*)(u64, u64, u64, u64, u64, const struct bpf_insn *)) \
| ^
kernel/bpf/core.c:1712:3: note: in expansion of macro '__bpf_call_base_args'
1712 | __bpf_call_base_args;
| ^~~~~~~~~~~~~~~~~~~~
--
In file included from kernel/bpf/verifier.c:10:
> include/linux/bpf.h:677:15: error: unknown type name
'bpf_trampoline'
677 | static inline bpf_trampoline
*bpf_trampoline_get(u64 key, void *addr,
| ^~~~~~~~~~~~~~
In file included from include/linux/bpf_verifier.h:8,
from kernel/bpf/verifier.c:12:
kernel/bpf/verifier.c: In function 'jit_subprogs':
include/linux/filter.h:345:4: warning: cast between incompatible function types from
'unsigned int (*)(const void *, const struct bpf_insn *)' to 'u64 (*)(u64,
u64, u64, u64, u64)' {aka 'long long unsigned int (*)(long long unsigned int,
long long unsigned int, long long unsigned int, long long unsigned int, long long
unsigned int)'} [-Wcast-function-type]
345 | ((u64 (*)(u64, u64, u64, u64, u64))(x))
| ^
kernel/bpf/verifier.c:10275:16: note: in expansion of macro 'BPF_CAST_CALL'
10275 | insn->imm = BPF_CAST_CALL(func[subprog]->bpf_func) -
| ^~~~~~~~~~~~~
kernel/bpf/verifier.c: In function 'fixup_bpf_calls':
include/linux/filter.h:345:4: warning: cast between incompatible function types from
'void * (* const)(struct bpf_map *, void *)' to 'u64 (*)(u64, u64, u64,
u64, u64)' {aka 'long long unsigned int (*)(long long unsigned int, long long
unsigned int, long long unsigned int, long long unsigned int, long long unsigned
int)'} [-Wcast-function-type]
345 | ((u64 (*)(u64, u64, u64, u64, u64))(x))
| ^
kernel/bpf/verifier.c:10650:17: note: in expansion of macro 'BPF_CAST_CALL'
10650 | insn->imm = BPF_CAST_CALL(ops->map_lookup_elem) -
| ^~~~~~~~~~~~~
include/linux/filter.h:345:4: warning: cast between incompatible function types from
'int (* const)(struct bpf_map *, void *, void *, u64)' {aka 'int (*
const)(struct bpf_map *, void *, void *, long long unsigned int)'} to 'u64
(*)(u64, u64, u64, u64, u64)' {aka 'long long unsigned int (*)(long long
unsigned int, long long unsigned int, long long unsigned int, long long unsigned int,
long long unsigned int)'} [-Wcast-function-type]
345 | ((u64 (*)(u64, u64, u64, u64, u64))(x))
| ^
kernel/bpf/verifier.c:10654:17: note: in expansion of macro 'BPF_CAST_CALL'
10654 | insn->imm = BPF_CAST_CALL(ops->map_update_elem) -
| ^~~~~~~~~~~~~
include/linux/filter.h:345:4: warning: cast between incompatible function types from
'int (* const)(struct bpf_map *, void *)' to 'u64 (*)(u64, u64, u64, u64,
u64)' {aka 'long long unsigned int (*)(long long unsigned int, long long unsigned
int, long long unsigned int, long long unsigned int, long long unsigned int)'}
[-Wcast-function-type]
345 | ((u64 (*)(u64, u64, u64, u64, u64))(x))
| ^
kernel/bpf/verifier.c:10658:17: note: in expansion of macro 'BPF_CAST_CALL'
10658 | insn->imm = BPF_CAST_CALL(ops->map_delete_elem) -
| ^~~~~~~~~~~~~
include/linux/filter.h:345:4: warning: cast between incompatible function types from
'int (* const)(struct bpf_map *, void *, u64)' {aka 'int (* const)(struct
bpf_map *, void *, long long unsigned int)'} to 'u64 (*)(u64, u64, u64, u64,
u64)' {aka 'long long unsigned int (*)(long long unsigned int, long long unsigned
int, long long unsigned int, long long unsigned int, long long unsigned int)'}
[-Wcast-function-type]
345 | ((u64 (*)(u64, u64, u64, u64, u64))(x))
| ^
kernel/bpf/verifier.c:10662:17: note: in expansion of macro 'BPF_CAST_CALL'
10662 | insn->imm = BPF_CAST_CALL(ops->map_push_elem) -
| ^~~~~~~~~~~~~
include/linux/filter.h:345:4: warning: cast between incompatible function types from
'int (* const)(struct bpf_map *, void *)' to 'u64 (*)(u64, u64, u64, u64,
u64)' {aka 'long long unsigned int (*)(long long unsigned int, long long unsigned
int, long long unsigned int, long long unsigned int, long long unsigned int)'}
[-Wcast-function-type]
345 | ((u64 (*)(u64, u64, u64, u64, u64))(x))
| ^
kernel/bpf/verifier.c:10666:17: note: in expansion of macro 'BPF_CAST_CALL'
10666 | insn->imm = BPF_CAST_CALL(ops->map_pop_elem) -
| ^~~~~~~~~~~~~
include/linux/filter.h:345:4: warning: cast between incompatible function types from
'int (* const)(struct bpf_map *, void *)' to 'u64 (*)(u64, u64, u64, u64,
u64)' {aka 'long long unsigned int (*)(long long unsigned int, long long unsigned
int, long long unsigned int, long long unsigned int, long long unsigned int)'}
[-Wcast-function-type]
345 | ((u64 (*)(u64, u64, u64, u64, u64))(x))
| ^
kernel/bpf/verifier.c:10670:17: note: in expansion of macro 'BPF_CAST_CALL'
10670 | insn->imm = BPF_CAST_CALL(ops->map_peek_elem) -
| ^~~~~~~~~~~~~
kernel/bpf/verifier.c: In function 'check_attach_btf_id':
> kernel/bpf/verifier.c:11335:5: error: assignment to 'struct
bpf_trampoline *' from incompatible pointer type 'int *'
[-Werror=incompatible-pointer-types]
11335 | tr = bpf_trampoline_get(key, (void
*)addr, &fmodel);
| ^
cc1: some warnings being treated as errors
..
#
https://github.com/0day-ci/linux/commit/a8ac936b7bd5e7363a8a335bc657635f4...
git remote add linux-review
https://github.com/0day-ci/linux
git fetch --no-tags linux-review
Toke-H-iland-J-rgensen/bpf-Support-multi-attach-for-freplace-programs/20200915-003428
git checkout a8ac936b7bd5e7363a8a335bc657635f4cf0fe24
vim +/bpf_trampoline +677 include/linux/bpf.h
634
635 #define DEFINE_BPF_DISPATCHER(name) \
636 noinline unsigned int bpf_dispatcher_##name##_func( \
637 const void *ctx, \
638 const struct bpf_insn *insnsi, \
639 unsigned int (*bpf_func)(const void *, \
640 const struct bpf_insn *)) \
641 { \
642 return bpf_func(ctx, insnsi); \
643 } \
644 EXPORT_SYMBOL(bpf_dispatcher_##name##_func); \
645 struct bpf_dispatcher bpf_dispatcher_##name = \
646 BPF_DISPATCHER_INIT(bpf_dispatcher_##name);
647 #define DECLARE_BPF_DISPATCHER(name) \
648 unsigned int bpf_dispatcher_##name##_func( \
649 const void *ctx, \
650 const struct bpf_insn *insnsi, \
651 unsigned int (*bpf_func)(const void *, \
652 const struct bpf_insn *)); \
653 extern struct bpf_dispatcher bpf_dispatcher_##name;
654 #define BPF_DISPATCHER_FUNC(name) bpf_dispatcher_##name##_func
655 #define BPF_DISPATCHER_PTR(name) (&bpf_dispatcher_##name)
656 void bpf_dispatcher_change_prog(struct bpf_dispatcher *d, struct bpf_prog *from,
657 struct bpf_prog *to);
658 /* Called only from JIT-enabled code, so there's no need for stubs. */
659 void *bpf_jit_alloc_exec_page(void);
660 void bpf_image_ksym_add(void *data, struct bpf_ksym *ksym);
661 void bpf_image_ksym_del(struct bpf_ksym *ksym);
662 void bpf_ksym_add(struct bpf_ksym *ksym);
663 void bpf_ksym_del(struct bpf_ksym *ksym);
664 #else
665 static inline struct bpf_trampoline *bpf_trampoline_lookup(u64 key)
666 {
667 return NULL;
668 }
669 static inline int bpf_trampoline_link_prog(struct bpf_prog *prog)
670 {
671 return -ENOTSUPP;
672 }
673 static inline int bpf_trampoline_unlink_prog(struct bpf_prog *prog)
674 {
675 return -ENOTSUPP;
676 }
677 static inline bpf_trampoline *bpf_trampoline_get(u64 key, void
*addr,
678 struct btf_func_model *fmodel)
679 {
680 return ERR_PTR(-EOPNOTSUPP);
681 }
682 static inline void bpf_trampoline_put(struct bpf_trampoline *tr) {}
683 #define DEFINE_BPF_DISPATCHER(name)
684 #define DECLARE_BPF_DISPATCHER(name)
685 #define BPF_DISPATCHER_FUNC(name) bpf_dispatcher_nop_func
686 #define BPF_DISPATCHER_PTR(name) NULL
687 static inline void bpf_dispatcher_change_prog(struct bpf_dispatcher *d,
688 struct bpf_prog *from,
689 struct bpf_prog *to) {}
690 static inline bool is_bpf_image_address(unsigned long address)
691 {
692 return false;
693 }
694 #endif
695
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org