* [ast:syscall 3/7] kernel/bpf/syscall.c:4364:5: warning: no previous prototype for function '__sys_bpf'
@ 2021-02-26 6:56 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-02-26 6:56 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 12774 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/ast/bpf.git syscall
head: 47fe65ef6f93a607b836a1d07c7bbec38c0d5ffb
commit: 245b79a6f2d9ed10ab1e7d02ec678cdc2aa8e73a [3/7] bpf: Prepare bpf syscall to be used from kernel and user space.
config: powerpc64-randconfig-r004-20210225 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project b889ef4214bc6dc8880fdd4badc0dcd9a3197753)
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 powerpc64 cross compiling tool for clang build
# apt-get install binutils-powerpc64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/ast/bpf.git/commit/?id=245b79a6f2d9ed10ab1e7d02ec678cdc2aa8e73a
git remote add ast https://git.kernel.org/pub/scm/linux/kernel/git/ast/bpf.git
git fetch --no-tags ast syscall
git checkout 245b79a6f2d9ed10ab1e7d02ec678cdc2aa8e73a
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
In file included from include/linux/skbuff.h:31:
In file included from include/linux/dma-mapping.h:10:
In file included from include/linux/scatterlist.h:9:
In file included from arch/powerpc/include/asm/io.h:619:
arch/powerpc/include/asm/io-defs.h:45:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(insw, (unsigned long p, void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:32:1: note: expanded from here
__do_insw
^
arch/powerpc/include/asm/io.h:557:56: note: expanded from macro '__do_insw'
#define __do_insw(p, b, n) readsw((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
~~~~~~~~~~~~~~~~~~~~~^
In file included from kernel/bpf/syscall.c:5:
In file included from include/linux/bpf_trace.h:5:
In file included from include/trace/events/xdp.h:8:
In file included from include/linux/netdevice.h:37:
In file included from include/net/net_namespace.h:39:
In file included from include/linux/skbuff.h:31:
In file included from include/linux/dma-mapping.h:10:
In file included from include/linux/scatterlist.h:9:
In file included from arch/powerpc/include/asm/io.h:619:
arch/powerpc/include/asm/io-defs.h:47:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(insl, (unsigned long p, void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:34:1: note: expanded from here
__do_insl
^
arch/powerpc/include/asm/io.h:558:56: note: expanded from macro '__do_insl'
#define __do_insl(p, b, n) readsl((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
~~~~~~~~~~~~~~~~~~~~~^
In file included from kernel/bpf/syscall.c:5:
In file included from include/linux/bpf_trace.h:5:
In file included from include/trace/events/xdp.h:8:
In file included from include/linux/netdevice.h:37:
In file included from include/net/net_namespace.h:39:
In file included from include/linux/skbuff.h:31:
In file included from include/linux/dma-mapping.h:10:
In file included from include/linux/scatterlist.h:9:
In file included from arch/powerpc/include/asm/io.h:619:
arch/powerpc/include/asm/io-defs.h:49:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(outsb, (unsigned long p, const void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:36:1: note: expanded from here
__do_outsb
^
arch/powerpc/include/asm/io.h:559:58: note: expanded from macro '__do_outsb'
#define __do_outsb(p, b, n) writesb((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
~~~~~~~~~~~~~~~~~~~~~^
In file included from kernel/bpf/syscall.c:5:
In file included from include/linux/bpf_trace.h:5:
In file included from include/trace/events/xdp.h:8:
In file included from include/linux/netdevice.h:37:
In file included from include/net/net_namespace.h:39:
In file included from include/linux/skbuff.h:31:
In file included from include/linux/dma-mapping.h:10:
In file included from include/linux/scatterlist.h:9:
In file included from arch/powerpc/include/asm/io.h:619:
arch/powerpc/include/asm/io-defs.h:51:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(outsw, (unsigned long p, const void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:38:1: note: expanded from here
__do_outsw
^
arch/powerpc/include/asm/io.h:560:58: note: expanded from macro '__do_outsw'
#define __do_outsw(p, b, n) writesw((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
~~~~~~~~~~~~~~~~~~~~~^
In file included from kernel/bpf/syscall.c:5:
In file included from include/linux/bpf_trace.h:5:
In file included from include/trace/events/xdp.h:8:
In file included from include/linux/netdevice.h:37:
In file included from include/net/net_namespace.h:39:
In file included from include/linux/skbuff.h:31:
In file included from include/linux/dma-mapping.h:10:
In file included from include/linux/scatterlist.h:9:
In file included from arch/powerpc/include/asm/io.h:619:
arch/powerpc/include/asm/io-defs.h:53:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(outsl, (unsigned long p, const void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:40:1: note: expanded from here
__do_outsl
^
arch/powerpc/include/asm/io.h:561:58: note: expanded from macro '__do_outsl'
#define __do_outsl(p, b, n) writesl((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
~~~~~~~~~~~~~~~~~~~~~^
>> kernel/bpf/syscall.c:4364:5: warning: no previous prototype for function '__sys_bpf' [-Wmissing-prototypes]
int __sys_bpf(int cmd, bpfptr_t uattr, unsigned int size)
^
kernel/bpf/syscall.c:4364:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int __sys_bpf(int cmd, bpfptr_t uattr, unsigned int size)
^
static
13 warnings generated.
vim +/__sys_bpf +4364 kernel/bpf/syscall.c
4363
> 4364 int __sys_bpf(int cmd, bpfptr_t uattr, unsigned int size)
4365 {
4366 union bpf_attr attr;
4367 int err;
4368
4369 if (sysctl_unprivileged_bpf_disabled && !bpf_capable())
4370 return -EPERM;
4371
4372 err = bpf_check_uarg_tail_zero(uattr, sizeof(attr), size);
4373 if (err)
4374 return err;
4375 size = min_t(u32, size, sizeof(attr));
4376
4377 /* copy attributes from user space, may be less than sizeof(bpf_attr) */
4378 memset(&attr, 0, sizeof(attr));
4379 if (copy_from_bpfptr(&attr, uattr, size) != 0)
4380 return -EFAULT;
4381
4382 err = security_bpf(cmd, &attr, size);
4383 if (err < 0)
4384 return err;
4385
4386 switch (cmd) {
4387 case BPF_MAP_CREATE:
4388 err = map_create(&attr);
4389 break;
4390 case BPF_MAP_LOOKUP_ELEM:
4391 err = map_lookup_elem(&attr);
4392 break;
4393 case BPF_MAP_UPDATE_ELEM:
4394 err = map_update_elem(&attr, uattr);
4395 break;
4396 case BPF_MAP_DELETE_ELEM:
4397 err = map_delete_elem(&attr);
4398 break;
4399 case BPF_MAP_GET_NEXT_KEY:
4400 err = map_get_next_key(&attr);
4401 break;
4402 case BPF_MAP_FREEZE:
4403 err = map_freeze(&attr);
4404 break;
4405 case BPF_PROG_LOAD:
4406 err = bpf_prog_load(&attr, uattr);
4407 break;
4408 case BPF_OBJ_PIN:
4409 err = bpf_obj_pin(&attr);
4410 break;
4411 case BPF_OBJ_GET:
4412 err = bpf_obj_get(&attr);
4413 break;
4414 case BPF_PROG_ATTACH:
4415 err = bpf_prog_attach(&attr);
4416 break;
4417 case BPF_PROG_DETACH:
4418 err = bpf_prog_detach(&attr);
4419 break;
4420 case BPF_PROG_QUERY:
4421 err = bpf_prog_query(&attr, uattr.user);
4422 break;
4423 case BPF_PROG_TEST_RUN:
4424 err = bpf_prog_test_run(&attr, uattr.user);
4425 break;
4426 case BPF_PROG_GET_NEXT_ID:
4427 err = bpf_obj_get_next_id(&attr, uattr.user,
4428 &prog_idr, &prog_idr_lock);
4429 break;
4430 case BPF_MAP_GET_NEXT_ID:
4431 err = bpf_obj_get_next_id(&attr, uattr.user,
4432 &map_idr, &map_idr_lock);
4433 break;
4434 case BPF_BTF_GET_NEXT_ID:
4435 err = bpf_obj_get_next_id(&attr, uattr.user,
4436 &btf_idr, &btf_idr_lock);
4437 break;
4438 case BPF_PROG_GET_FD_BY_ID:
4439 err = bpf_prog_get_fd_by_id(&attr);
4440 break;
4441 case BPF_MAP_GET_FD_BY_ID:
4442 err = bpf_map_get_fd_by_id(&attr);
4443 break;
4444 case BPF_OBJ_GET_INFO_BY_FD:
4445 err = bpf_obj_get_info_by_fd(&attr, uattr.user);
4446 break;
4447 case BPF_RAW_TRACEPOINT_OPEN:
4448 err = bpf_raw_tracepoint_open(&attr);
4449 break;
4450 case BPF_BTF_LOAD:
4451 err = bpf_btf_load(&attr);
4452 break;
4453 case BPF_BTF_GET_FD_BY_ID:
4454 err = bpf_btf_get_fd_by_id(&attr);
4455 break;
4456 case BPF_TASK_FD_QUERY:
4457 err = bpf_task_fd_query(&attr, uattr.user);
4458 break;
4459 case BPF_MAP_LOOKUP_AND_DELETE_ELEM:
4460 err = map_lookup_and_delete_elem(&attr);
4461 break;
4462 case BPF_MAP_LOOKUP_BATCH:
4463 err = bpf_map_do_batch(&attr, uattr.user, BPF_MAP_LOOKUP_BATCH);
4464 break;
4465 case BPF_MAP_LOOKUP_AND_DELETE_BATCH:
4466 err = bpf_map_do_batch(&attr, uattr.user,
4467 BPF_MAP_LOOKUP_AND_DELETE_BATCH);
4468 break;
4469 case BPF_MAP_UPDATE_BATCH:
4470 err = bpf_map_do_batch(&attr, uattr.user, BPF_MAP_UPDATE_BATCH);
4471 break;
4472 case BPF_MAP_DELETE_BATCH:
4473 err = bpf_map_do_batch(&attr, uattr.user, BPF_MAP_DELETE_BATCH);
4474 break;
4475 case BPF_LINK_CREATE:
4476 err = link_create(&attr, uattr);
4477 break;
4478 case BPF_LINK_UPDATE:
4479 err = link_update(&attr);
4480 break;
4481 case BPF_LINK_GET_FD_BY_ID:
4482 err = bpf_link_get_fd_by_id(&attr);
4483 break;
4484 case BPF_LINK_GET_NEXT_ID:
4485 err = bpf_obj_get_next_id(&attr, uattr.user,
4486 &link_idr, &link_idr_lock);
4487 break;
4488 case BPF_ENABLE_STATS:
4489 err = bpf_enable_stats(&attr);
4490 break;
4491 case BPF_ITER_CREATE:
4492 err = bpf_iter_create(&attr);
4493 break;
4494 case BPF_LINK_DETACH:
4495 err = link_detach(&attr);
4496 break;
4497 case BPF_PROG_BIND_MAP:
4498 err = bpf_prog_bind_map(&attr);
4499 break;
4500 default:
4501 err = -EINVAL;
4502 break;
4503 }
4504
4505 return err;
4506 }
4507
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 21823 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-02-26 6:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-26 6:56 [ast:syscall 3/7] kernel/bpf/syscall.c:4364:5: warning: no previous prototype for function '__sys_bpf' kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.