Hi Yonghong, I love your patch! Yet something to improve: [auto build test ERROR on bpf-next/master] url: https://github.com/intel-lab-lkp/linux/commits/Yonghong-Song/bpf-Add-bpf_rcu_read_lock-support/20221108-155529 base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master patch link: https://lore.kernel.org/r/20221108074104.263145-1-yhs%40fb.com patch subject: [PATCH bpf-next v2 3/8] bpf: Abstract out functions to check sleepable helpers config: arm-neponset_defconfig compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 463da45892e2d2a262277b91b96f5f8c05dc25d0) 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 # install arm cross compiling tool for clang build # apt-get install binutils-arm-linux-gnueabi # https://github.com/intel-lab-lkp/linux/commit/97528bc3a813d7e2b950063b7a1912672bcae1e7 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Yonghong-Song/bpf-Add-bpf_rcu_read_lock-support/20221108-155529 git checkout 97528bc3a813d7e2b950063b7a1912672bcae1e7 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot All errors (new ones prefixed by >>): In file included from init/main.c:21: In file included from include/linux/syscalls.h:88: In file included from include/trace/syscall.h:7: >> include/linux/trace_events.h:801:51: error: variable has incomplete type 'enum bpf_func_id' bpf_tracing_sleepable_func_proto(enum bpf_func_id func_id) ^ include/linux/trace_events.h:20:6: note: forward declaration of 'enum bpf_func_id' enum bpf_func_id; ^ init/main.c:772:20: warning: no previous prototype for function 'arch_post_acpi_subsys_init' [-Wmissing-prototypes] void __init __weak arch_post_acpi_subsys_init(void) { } ^ init/main.c:772:1: note: declare 'static' if the function is not intended to be used outside of this translation unit void __init __weak arch_post_acpi_subsys_init(void) { } ^ static init/main.c:784:20: warning: no previous prototype for function 'mem_encrypt_init' [-Wmissing-prototypes] void __init __weak mem_encrypt_init(void) { } ^ init/main.c:784:1: note: declare 'static' if the function is not intended to be used outside of this translation unit void __init __weak mem_encrypt_init(void) { } ^ static init/main.c:786:20: warning: no previous prototype for function 'poking_init' [-Wmissing-prototypes] void __init __weak poking_init(void) { } ^ init/main.c:786:1: note: declare 'static' if the function is not intended to be used outside of this translation unit void __init __weak poking_init(void) { } ^ static 3 warnings and 1 error generated. -- In file included from init/do_mounts.c:28: In file included from init/do_mounts.h:5: In file included from include/linux/syscalls.h:88: In file included from include/trace/syscall.h:7: >> include/linux/trace_events.h:801:51: error: variable has incomplete type 'enum bpf_func_id' bpf_tracing_sleepable_func_proto(enum bpf_func_id func_id) ^ include/linux/trace_events.h:20:6: note: forward declaration of 'enum bpf_func_id' enum bpf_func_id; ^ 1 error generated. -- In file included from kernel/fork.c:55: In file included from include/linux/syscalls.h:88: In file included from include/trace/syscall.h:7: >> include/linux/trace_events.h:801:51: error: variable has incomplete type 'enum bpf_func_id' bpf_tracing_sleepable_func_proto(enum bpf_func_id func_id) ^ include/linux/trace_events.h:20:6: note: forward declaration of 'enum bpf_func_id' enum bpf_func_id; ^ kernel/fork.c:162:13: warning: no previous prototype for function 'arch_release_task_struct' [-Wmissing-prototypes] void __weak arch_release_task_struct(struct task_struct *tsk) ^ kernel/fork.c:162:1: note: declare 'static' if the function is not intended to be used outside of this translation unit void __weak arch_release_task_struct(struct task_struct *tsk) ^ static kernel/fork.c:849:20: warning: no previous prototype for function 'arch_task_cache_init' [-Wmissing-prototypes] void __init __weak arch_task_cache_init(void) { } ^ kernel/fork.c:849:1: note: declare 'static' if the function is not intended to be used outside of this translation unit void __init __weak arch_task_cache_init(void) { } ^ static kernel/fork.c:944:12: warning: no previous prototype for function 'arch_dup_task_struct' [-Wmissing-prototypes] int __weak arch_dup_task_struct(struct task_struct *dst, ^ kernel/fork.c:944:1: note: declare 'static' if the function is not intended to be used outside of this translation unit int __weak arch_dup_task_struct(struct task_struct *dst, ^ static 3 warnings and 1 error generated. -- In file included from kernel/signal.c:30: In file included from include/linux/syscalls.h:88: In file included from include/trace/syscall.h:7: >> include/linux/trace_events.h:801:51: error: variable has incomplete type 'enum bpf_func_id' bpf_tracing_sleepable_func_proto(enum bpf_func_id func_id) ^ include/linux/trace_events.h:20:6: note: forward declaration of 'enum bpf_func_id' enum bpf_func_id; ^ kernel/signal.c:137:37: warning: array index 3 is past the end of the array (that has type 'unsigned long[2]') [-Warray-bounds] case 4: ready = signal->sig[3] &~ blocked->sig[3]; ^ ~ arch/arm/include/asm/signal.h:17:2: note: array 'sig' declared here unsigned long sig[_NSIG_WORDS]; ^ kernel/signal.c:137:19: warning: array index 3 is past the end of the array (that has type 'unsigned long[2]') [-Warray-bounds] case 4: ready = signal->sig[3] &~ blocked->sig[3]; ^ ~ arch/arm/include/asm/signal.h:17:2: note: array 'sig' declared here unsigned long sig[_NSIG_WORDS]; ^ kernel/signal.c:138:30: warning: array index 2 is past the end of the array (that has type 'unsigned long[2]') [-Warray-bounds] ready |= signal->sig[2] &~ blocked->sig[2]; ^ ~ arch/arm/include/asm/signal.h:17:2: note: array 'sig' declared here unsigned long sig[_NSIG_WORDS]; ^ kernel/signal.c:138:12: warning: array index 2 is past the end of the array (that has type 'unsigned long[2]') [-Warray-bounds] ready |= signal->sig[2] &~ blocked->sig[2]; ^ ~ arch/arm/include/asm/signal.h:17:2: note: array 'sig' declared here unsigned long sig[_NSIG_WORDS]; ^ 4 warnings and 1 error generated. -- In file included from arch/arm/kernel/signal.c:14: In file included from include/linux/syscalls.h:88: In file included from include/trace/syscall.h:7: >> include/linux/trace_events.h:801:51: error: variable has incomplete type 'enum bpf_func_id' bpf_tracing_sleepable_func_proto(enum bpf_func_id func_id) ^ include/linux/trace_events.h:20:6: note: forward declaration of 'enum bpf_func_id' enum bpf_func_id; ^ arch/arm/kernel/signal.c:142:15: warning: variable 'aux' set but not used [-Wunused-but-set-variable] char __user *aux; ^ arch/arm/kernel/signal.c:186:16: warning: no previous prototype for function 'sys_sigreturn' [-Wmissing-prototypes] asmlinkage int sys_sigreturn(struct pt_regs *regs) ^ arch/arm/kernel/signal.c:186:12: note: declare 'static' if the function is not intended to be used outside of this translation unit asmlinkage int sys_sigreturn(struct pt_regs *regs) ^ static arch/arm/kernel/signal.c:216:16: warning: no previous prototype for function 'sys_rt_sigreturn' [-Wmissing-prototypes] asmlinkage int sys_rt_sigreturn(struct pt_regs *regs) ^ arch/arm/kernel/signal.c:216:12: note: declare 'static' if the function is not intended to be used outside of this translation unit asmlinkage int sys_rt_sigreturn(struct pt_regs *regs) ^ static arch/arm/kernel/signal.c:601:1: warning: no previous prototype for function 'do_work_pending' [-Wmissing-prototypes] do_work_pending(struct pt_regs *regs, unsigned int thread_flags, int syscall) ^ arch/arm/kernel/signal.c:600:12: note: declare 'static' if the function is not intended to be used outside of this translation unit asmlinkage int ^ static 4 warnings and 1 error generated. -- In file included from arch/arm/kernel/sys_arm.c:20: In file included from include/linux/syscalls.h:88: In file included from include/trace/syscall.h:7: >> include/linux/trace_events.h:801:51: error: variable has incomplete type 'enum bpf_func_id' bpf_tracing_sleepable_func_proto(enum bpf_func_id func_id) ^ include/linux/trace_events.h:20:6: note: forward declaration of 'enum bpf_func_id' enum bpf_func_id; ^ In file included from arch/arm/kernel/sys_arm.c:21: include/linux/mman.h:154:9: warning: division by zero is undefined [-Wdivision-by-zero] _calc_vm_trans(flags, MAP_SYNC, VM_SYNC ) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/mman.h:132:21: note: expanded from macro '_calc_vm_trans' : ((x) & (bit1)) / ((bit1) / (bit2)))) ^ ~~~~~~~~~~~~~~~~~ arch/arm/kernel/sys_arm.c:32:17: warning: no previous prototype for function 'sys_arm_fadvise64_64' [-Wmissing-prototypes] asmlinkage long sys_arm_fadvise64_64(int fd, int advice, ^ arch/arm/kernel/sys_arm.c:32:12: note: declare 'static' if the function is not intended to be used outside of this translation unit asmlinkage long sys_arm_fadvise64_64(int fd, int advice, ^ static 2 warnings and 1 error generated. -- In file included from fs/pipe.c:24: In file included from include/linux/syscalls.h:88: In file included from include/trace/syscall.h:7: >> include/linux/trace_events.h:801:51: error: variable has incomplete type 'enum bpf_func_id' bpf_tracing_sleepable_func_proto(enum bpf_func_id func_id) ^ include/linux/trace_events.h:20:6: note: forward declaration of 'enum bpf_func_id' enum bpf_func_id; ^ fs/pipe.c:757:15: warning: no previous prototype for function 'account_pipe_buffers' [-Wmissing-prototypes] unsigned long account_pipe_buffers(struct user_struct *user, ^ fs/pipe.c:757:1: note: declare 'static' if the function is not intended to be used outside of this translation unit unsigned long account_pipe_buffers(struct user_struct *user, ^ static fs/pipe.c:763:6: warning: no previous prototype for function 'too_many_pipe_buffers_soft' [-Wmissing-prototypes] bool too_many_pipe_buffers_soft(unsigned long user_bufs) ^ fs/pipe.c:763:1: note: declare 'static' if the function is not intended to be used outside of this translation unit bool too_many_pipe_buffers_soft(unsigned long user_bufs) ^ static fs/pipe.c:770:6: warning: no previous prototype for function 'too_many_pipe_buffers_hard' [-Wmissing-prototypes] bool too_many_pipe_buffers_hard(unsigned long user_bufs) ^ fs/pipe.c:770:1: note: declare 'static' if the function is not intended to be used outside of this translation unit bool too_many_pipe_buffers_hard(unsigned long user_bufs) ^ static fs/pipe.c:777:6: warning: no previous prototype for function 'pipe_is_unprivileged_user' [-Wmissing-prototypes] bool pipe_is_unprivileged_user(void) ^ fs/pipe.c:777:1: note: declare 'static' if the function is not intended to be used outside of this translation unit bool pipe_is_unprivileged_user(void) ^ static fs/pipe.c:1253:5: warning: no previous prototype for function 'pipe_resize_ring' [-Wmissing-prototypes] int pipe_resize_ring(struct pipe_inode_info *pipe, unsigned int nr_slots) ^ fs/pipe.c:1253:1: note: declare 'static' if the function is not intended to be used outside of this translation unit int pipe_resize_ring(struct pipe_inode_info *pipe, unsigned int nr_slots) ^ static 5 warnings and 1 error generated. -- In file included from fs/d_path.c:2: In file included from include/linux/syscalls.h:88: In file included from include/trace/syscall.h:7: >> include/linux/trace_events.h:801:51: error: variable has incomplete type 'enum bpf_func_id' bpf_tracing_sleepable_func_proto(enum bpf_func_id func_id) ^ include/linux/trace_events.h:20:6: note: forward declaration of 'enum bpf_func_id' enum bpf_func_id; ^ fs/d_path.c:317:7: warning: no previous prototype for function 'simple_dname' [-Wmissing-prototypes] char *simple_dname(struct dentry *dentry, char *buffer, int buflen) ^ fs/d_path.c:317:1: note: declare 'static' if the function is not intended to be used outside of this translation unit char *simple_dname(struct dentry *dentry, char *buffer, int buflen) ^ static 1 warning and 1 error generated. -- In file included from fs/statfs.c:2: In file included from include/linux/syscalls.h:88: In file included from include/trace/syscall.h:7: >> include/linux/trace_events.h:801:51: error: variable has incomplete type 'enum bpf_func_id' bpf_tracing_sleepable_func_proto(enum bpf_func_id func_id) ^ include/linux/trace_events.h:20:6: note: forward declaration of 'enum bpf_func_id' enum bpf_func_id; ^ fs/statfs.c:131:3: warning: 'memcpy' will always overflow; destination buffer has size 64, but size argument is 88 [-Wfortify-source] memcpy(&buf, st, sizeof(*st)); ^ fs/statfs.c:172:3: warning: 'memcpy' will always overflow; destination buffer has size 84, but size argument is 88 [-Wfortify-source] memcpy(&buf, st, sizeof(*st)); ^ 2 warnings and 1 error generated. -- In file included from fs/aio.c:20: In file included from include/linux/syscalls.h:88: In file included from include/trace/syscall.h:7: >> include/linux/trace_events.h:801:51: error: variable has incomplete type 'enum bpf_func_id' bpf_tracing_sleepable_func_proto(enum bpf_func_id func_id) ^ include/linux/trace_events.h:20:6: note: forward declaration of 'enum bpf_func_id' enum bpf_func_id; ^ In file included from fs/aio.c:29: include/linux/mman.h:154:9: warning: division by zero is undefined [-Wdivision-by-zero] _calc_vm_trans(flags, MAP_SYNC, VM_SYNC ) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/mman.h:132:21: note: expanded from macro '_calc_vm_trans' : ((x) & (bit1)) / ((bit1) / (bit2)))) ^ ~~~~~~~~~~~~~~~~~ 1 warning and 1 error generated. -- In file included from ipc/msg.c:35: In file included from include/linux/syscalls.h:88: In file included from include/trace/syscall.h:7: >> include/linux/trace_events.h:801:51: error: variable has incomplete type 'enum bpf_func_id' bpf_tracing_sleepable_func_proto(enum bpf_func_id func_id) ^ include/linux/trace_events.h:20:6: note: forward declaration of 'enum bpf_func_id' enum bpf_func_id; ^ ipc/msg.c:497:20: warning: implicit conversion from 'int' to 'unsigned short' changes value from 32768000 to 0 [-Wconstant-conversion] msginfo->msgseg = MSGSEG; ~ ^~~~~~ include/uapi/linux/msg.h:87:38: note: expanded from macro 'MSGSEG' #define MSGSEG (__MSGSEG <= 0xffff ? __MSGSEG : 0xffff) ^~~~~~~~ include/uapi/linux/msg.h:86:36: note: expanded from macro '__MSGSEG' #define __MSGSEG ((MSGPOOL * 1024) / MSGSSZ) /* max no. of segments */ ~~~~~~~~~~~~~~~~~^~~~~~~~ 1 warning and 1 error generated. .. vim +801 include/linux/trace_events.h 767 768 static inline int 769 perf_event_query_prog_array(struct perf_event *event, void __user *info) 770 { 771 return -EOPNOTSUPP; 772 } 773 static inline int bpf_probe_register(struct bpf_raw_event_map *btp, struct bpf_prog *p) 774 { 775 return -EOPNOTSUPP; 776 } 777 static inline int bpf_probe_unregister(struct bpf_raw_event_map *btp, struct bpf_prog *p) 778 { 779 return -EOPNOTSUPP; 780 } 781 static inline struct bpf_raw_event_map *bpf_get_raw_tracepoint(const char *name) 782 { 783 return NULL; 784 } 785 static inline void bpf_put_raw_tracepoint(struct bpf_raw_event_map *btp) 786 { 787 } 788 static inline int bpf_get_perf_event_info(const struct perf_event *event, 789 u32 *prog_id, u32 *fd_type, 790 const char **buf, u64 *probe_offset, 791 u64 *probe_addr) 792 { 793 return -EOPNOTSUPP; 794 } 795 static inline int 796 bpf_kprobe_multi_link_attach(const union bpf_attr *attr, struct bpf_prog *prog) 797 { 798 return -EOPNOTSUPP; 799 } 800 static inline const struct bpf_func_proto * > 801 bpf_tracing_sleepable_func_proto(enum bpf_func_id func_id) 802 { 803 return NULL; 804 } 805 #endif 806 -- 0-DAY CI Kernel Test Service https://01.org/lkp