All of lore.kernel.org
 help / color / mirror / Atom feed
* [bpf-next:master 1540/1551] kernel/bpf/stackmap.c:688:29: error: passing argument 1 of '__bpf_get_stack' from incompatible pointer type
@ 2020-07-24 11:36 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2020-07-24 11:36 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 4832 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
head:   5ab739372a148bb4e35296edd3a63c8b17094019
commit: 03d42fd2d83fcaa545a23e2c4a06c447d531df89 [1540/1551] bpf: Separate bpf_get_[stack|stackid] for perf events BPF
config: s390-randconfig-r022-20200724 (attached as .config)
compiler: s390-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
        git checkout 03d42fd2d83fcaa545a23e2c4a06c447d531df89
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=s390 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   kernel/bpf/stackmap.c: In function '____bpf_get_stack_pe':
>> kernel/bpf/stackmap.c:688:29: error: passing argument 1 of '__bpf_get_stack' from incompatible pointer type [-Werror=incompatible-pointer-types]
     688 |   return __bpf_get_stack(ctx->regs, NULL, NULL, buf, size, flags);
         |                          ~~~^~~~~~
         |                             |
         |                             bpf_user_pt_regs_t * {aka struct <anonymous> *}
   kernel/bpf/stackmap.c:571:45: note: expected 'struct pt_regs *' but argument is of type 'bpf_user_pt_regs_t *' {aka 'struct <anonymous> *'}
     571 | static long __bpf_get_stack(struct pt_regs *regs, struct task_struct *task,
         |                             ~~~~~~~~~~~~~~~~^~~~
   kernel/bpf/stackmap.c:708:28: error: passing argument 1 of '__bpf_get_stack' from incompatible pointer type [-Werror=incompatible-pointer-types]
     708 |   err = __bpf_get_stack(ctx->regs, NULL, trace, buf,
         |                         ~~~^~~~~~
         |                            |
         |                            bpf_user_pt_regs_t * {aka struct <anonymous> *}
   kernel/bpf/stackmap.c:571:45: note: expected 'struct pt_regs *' but argument is of type 'bpf_user_pt_regs_t *' {aka 'struct <anonymous> *'}
     571 | static long __bpf_get_stack(struct pt_regs *regs, struct task_struct *task,
         |                             ~~~~~~~~~~~~~~~~^~~~
   kernel/bpf/stackmap.c:721:28: error: passing argument 1 of '__bpf_get_stack' from incompatible pointer type [-Werror=incompatible-pointer-types]
     721 |   err = __bpf_get_stack(ctx->regs, NULL, trace, buf,
         |                         ~~~^~~~~~
         |                            |
         |                            bpf_user_pt_regs_t * {aka struct <anonymous> *}
   kernel/bpf/stackmap.c:571:45: note: expected 'struct pt_regs *' but argument is of type 'bpf_user_pt_regs_t *' {aka 'struct <anonymous> *'}
     571 | static long __bpf_get_stack(struct pt_regs *regs, struct task_struct *task,
         |                             ~~~~~~~~~~~~~~~~^~~~
   cc1: some warnings being treated as errors

vim +/__bpf_get_stack +688 kernel/bpf/stackmap.c

   677	
   678	BPF_CALL_4(bpf_get_stack_pe, struct bpf_perf_event_data_kern *, ctx,
   679		   void *, buf, u32, size, u64, flags)
   680	{
   681		struct perf_event *event = ctx->event;
   682		struct perf_callchain_entry *trace;
   683		bool kernel, user;
   684		int err = -EINVAL;
   685		__u64 nr_kernel;
   686	
   687		if (!(event->attr.sample_type & __PERF_SAMPLE_CALLCHAIN_EARLY))
 > 688			return __bpf_get_stack(ctx->regs, NULL, NULL, buf, size, flags);
   689	
   690		if (unlikely(flags & ~(BPF_F_SKIP_FIELD_MASK | BPF_F_USER_STACK |
   691				       BPF_F_USER_BUILD_ID)))
   692			goto clear;
   693	
   694		user = flags & BPF_F_USER_STACK;
   695		kernel = !user;
   696	
   697		err = -EFAULT;
   698		trace = ctx->data->callchain;
   699		if (unlikely(!trace))
   700			goto clear;
   701	
   702		nr_kernel = count_kernel_ip(trace);
   703	
   704		if (kernel) {
   705			__u64 nr = trace->nr;
   706	
   707			trace->nr = nr_kernel;
   708			err = __bpf_get_stack(ctx->regs, NULL, trace, buf,
   709					      size, flags);
   710	
   711			/* restore nr */
   712			trace->nr = nr;
   713		} else { /* user */
   714			u64 skip = flags & BPF_F_SKIP_FIELD_MASK;
   715	
   716			skip += nr_kernel;
   717			if (skip > BPF_F_SKIP_FIELD_MASK)
   718				goto clear;
   719	
   720			flags = (flags & ~BPF_F_SKIP_FIELD_MASK) | skip;
   721			err = __bpf_get_stack(ctx->regs, NULL, trace, buf,
   722					      size, flags);
   723		}
   724		return err;
   725	
   726	clear:
   727		memset(buf, 0, size);
   728		return err;
   729	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 20788 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-07-24 11:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-24 11:36 [bpf-next:master 1540/1551] kernel/bpf/stackmap.c:688:29: error: passing argument 1 of '__bpf_get_stack' from incompatible pointer type 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.