linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Florent Revest <revest@chromium.org>, bpf@vger.kernel.org
Cc: kbuild-all@lists.01.org, clang-built-linux@googlegroups.com,
	ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org,
	kpsingh@kernel.org, jackmanb@google.com,
	linux-kernel@vger.kernel.org,
	Florent Revest <revest@chromium.org>,
	syzbot+63122d0bc347f18c1884@syzkaller.appspotmail.com
Subject: Re: [PATCH bpf] bpf: Fix nested bpf_bprintf_prepare with more per-cpu buffers
Date: Tue, 11 May 2021 09:21:02 +0800	[thread overview]
Message-ID: <202105110928.Z2YUEQLe-lkp@intel.com> (raw)
In-Reply-To: <20210510213709.2004366-1-revest@chromium.org>

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

Hi Florent,

I love your patch! Yet something to improve:

[auto build test ERROR on bpf/master]

url:    https://github.com/0day-ci/linux/commits/Florent-Revest/bpf-Fix-nested-bpf_bprintf_prepare-with-more-per-cpu-buffers/20210511-053835
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf.git master
config: powerpc-randconfig-r021-20210510 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project a0fed635fe1701470062495a6ffee1c608f3f1bc)
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 powerpc cross compiling tool for clang build
        # apt-get install binutils-powerpc-linux-gnu
        # https://github.com/0day-ci/linux/commit/1f5d45d9243d8ca8ece81e778579fc46a1946887
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Florent-Revest/bpf-Fix-nested-bpf_bprintf_prepare-with-more-per-cpu-buffers/20210511-053835
        git checkout 1f5d45d9243d8ca8ece81e778579fc46a1946887
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=powerpc 

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/helpers.c:718:23: error: use of undeclared identifier 'bpf_bprintf_buf'; did you mean 'bpf_bprintf_bufs'?
           bufs = this_cpu_ptr(&bpf_bprintf_buf);
                                ^~~~~~~~~~~~~~~
                                bpf_bprintf_bufs
   include/linux/percpu-defs.h:265:39: note: expanded from macro 'this_cpu_ptr'
   #define this_cpu_ptr(ptr)       raw_cpu_ptr(ptr)
                                               ^
   include/linux/percpu-defs.h:264:38: note: expanded from macro 'raw_cpu_ptr'
   #define raw_cpu_ptr(ptr)        per_cpu_ptr(ptr, 0)
                                               ^
   include/linux/percpu-defs.h:263:65: note: expanded from macro 'per_cpu_ptr'
   #define per_cpu_ptr(ptr, cpu)   ({ (void)(cpu); VERIFY_PERCPU_PTR(ptr); })
                                                                     ^
   include/linux/percpu-defs.h:259:20: note: expanded from macro 'VERIFY_PERCPU_PTR'
           __verify_pcpu_ptr(__p);                                         \
                             ^
   include/linux/percpu-defs.h:219:47: note: expanded from macro '__verify_pcpu_ptr'
           const void __percpu *__vpp_verify = (typeof((ptr) + 0))NULL;    \
                                                        ^
   kernel/bpf/helpers.c:703:48: note: 'bpf_bprintf_bufs' declared here
   static DEFINE_PER_CPU(struct bpf_bprintf_bufs, bpf_bprintf_bufs);
                                                  ^
>> kernel/bpf/helpers.c:718:9: error: arithmetic on a pointer to an incomplete type 'typeof(struct bpf_bprintf_bufs)' (aka 'struct bpf_bprintf_bufs')
           bufs = this_cpu_ptr(&bpf_bprintf_buf);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/percpu-defs.h:265:27: note: expanded from macro 'this_cpu_ptr'
   #define this_cpu_ptr(ptr)       raw_cpu_ptr(ptr)
                                   ^~~~~~~~~~~~~~~~
   include/linux/percpu-defs.h:264:26: note: expanded from macro 'raw_cpu_ptr'
   #define raw_cpu_ptr(ptr)        per_cpu_ptr(ptr, 0)
                                   ^~~~~~~~~~~~~~~~~~~
   include/linux/percpu-defs.h:263:47: note: expanded from macro 'per_cpu_ptr'
   #define per_cpu_ptr(ptr, cpu)   ({ (void)(cpu); VERIFY_PERCPU_PTR(ptr); })
                                                   ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/percpu-defs.h:259:2: note: expanded from macro 'VERIFY_PERCPU_PTR'
           __verify_pcpu_ptr(__p);                                         \
           ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/percpu-defs.h:219:52: note: expanded from macro '__verify_pcpu_ptr'
           const void __percpu *__vpp_verify = (typeof((ptr) + 0))NULL;    \
                                                       ~~~~~ ^
   kernel/bpf/helpers.c:703:30: note: forward declaration of 'struct bpf_bprintf_bufs'
   static DEFINE_PER_CPU(struct bpf_bprintf_bufs, bpf_bprintf_bufs);
                                ^
>> kernel/bpf/helpers.c:718:23: error: use of undeclared identifier 'bpf_bprintf_buf'; did you mean 'bpf_bprintf_bufs'?
           bufs = this_cpu_ptr(&bpf_bprintf_buf);
                                ^~~~~~~~~~~~~~~
                                bpf_bprintf_bufs
   include/linux/percpu-defs.h:265:39: note: expanded from macro 'this_cpu_ptr'
   #define this_cpu_ptr(ptr)       raw_cpu_ptr(ptr)
                                               ^
   include/linux/percpu-defs.h:264:38: note: expanded from macro 'raw_cpu_ptr'
   #define raw_cpu_ptr(ptr)        per_cpu_ptr(ptr, 0)
                                               ^
   include/linux/percpu-defs.h:263:65: note: expanded from macro 'per_cpu_ptr'
   #define per_cpu_ptr(ptr, cpu)   ({ (void)(cpu); VERIFY_PERCPU_PTR(ptr); })
                                                                     ^
   include/linux/percpu-defs.h:260:12: note: expanded from macro 'VERIFY_PERCPU_PTR'
           (typeof(*(__p)) __kernel __force *)(__p);                       \
                     ^
   kernel/bpf/helpers.c:703:48: note: 'bpf_bprintf_bufs' declared here
   static DEFINE_PER_CPU(struct bpf_bprintf_bufs, bpf_bprintf_bufs);
                                                  ^
>> kernel/bpf/helpers.c:718:23: error: use of undeclared identifier 'bpf_bprintf_buf'; did you mean 'bpf_bprintf_bufs'?
           bufs = this_cpu_ptr(&bpf_bprintf_buf);
                                ^~~~~~~~~~~~~~~
                                bpf_bprintf_bufs
   include/linux/percpu-defs.h:265:39: note: expanded from macro 'this_cpu_ptr'
   #define this_cpu_ptr(ptr)       raw_cpu_ptr(ptr)
                                               ^
   include/linux/percpu-defs.h:264:38: note: expanded from macro 'raw_cpu_ptr'
   #define raw_cpu_ptr(ptr)        per_cpu_ptr(ptr, 0)
                                               ^
   include/linux/percpu-defs.h:263:65: note: expanded from macro 'per_cpu_ptr'
   #define per_cpu_ptr(ptr, cpu)   ({ (void)(cpu); VERIFY_PERCPU_PTR(ptr); })
                                                                     ^
   include/linux/percpu-defs.h:260:38: note: expanded from macro 'VERIFY_PERCPU_PTR'
           (typeof(*(__p)) __kernel __force *)(__p);                       \
                                               ^
   kernel/bpf/helpers.c:703:48: note: 'bpf_bprintf_bufs' declared here
   static DEFINE_PER_CPU(struct bpf_bprintf_bufs, bpf_bprintf_bufs);
                                                  ^
>> kernel/bpf/helpers.c:718:7: error: incompatible pointer types assigning to 'struct bpf_bprintf_buffers *' from 'typeof (*(&bpf_bprintf_bufs)) *' (aka 'struct bpf_bprintf_bufs *') [-Werror,-Wincompatible-pointer-types]
           bufs = this_cpu_ptr(&bpf_bprintf_buf);
                ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> kernel/bpf/helpers.c:703:48: error: tentative definition has type 'typeof(struct bpf_bprintf_bufs)' (aka 'struct bpf_bprintf_bufs') that is never completed
   static DEFINE_PER_CPU(struct bpf_bprintf_bufs, bpf_bprintf_bufs);
                                                  ^
   kernel/bpf/helpers.c:703:30: note: forward declaration of 'struct bpf_bprintf_bufs'
   static DEFINE_PER_CPU(struct bpf_bprintf_bufs, bpf_bprintf_bufs);
                                ^
   6 errors generated.


vim +718 kernel/bpf/helpers.c

   698	
   699	/* Support executing three nested bprintf helper calls on a given CPU */
   700	struct bpf_bprintf_buffers {
   701		char tmp_bufs[3][MAX_PRINTF_BUF_LEN];
   702	};
 > 703	static DEFINE_PER_CPU(struct bpf_bprintf_bufs, bpf_bprintf_bufs);
   704	static DEFINE_PER_CPU(int, bpf_bprintf_nest_level);
   705	
   706	static int try_get_fmt_tmp_buf(char **tmp_buf)
   707	{
   708		struct bpf_bprintf_buffers *bufs;
   709		int nest_level;
   710	
   711		preempt_disable();
   712		nest_level = this_cpu_inc_return(bpf_bprintf_nest_level);
   713		if (WARN_ON_ONCE(nest_level > ARRAY_SIZE(bufs->tmp_bufs))) {
   714			this_cpu_dec(bpf_bprintf_nest_level);
   715			preempt_enable();
   716			return -EBUSY;
   717		}
 > 718		bufs = this_cpu_ptr(&bpf_bprintf_buf);
   719		*tmp_buf = bufs->tmp_bufs[nest_level - 1];
   720	
   721		return 0;
   722	}
   723	

---
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: 31150 bytes --]

  reply	other threads:[~2021-05-11  1:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-10 21:37 [PATCH bpf] bpf: Fix nested bpf_bprintf_prepare with more per-cpu buffers Florent Revest
2021-05-11  1:21 ` kernel test robot [this message]
2021-05-11  1:57 ` kernel test robot
2021-05-11  8:09   ` Florent Revest

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202105110928.Z2YUEQLe-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=clang-built-linux@googlegroups.com \
    --cc=daniel@iogearbox.net \
    --cc=jackmanb@google.com \
    --cc=kbuild-all@lists.01.org \
    --cc=kpsingh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=revest@chromium.org \
    --cc=syzbot+63122d0bc347f18c1884@syzkaller.appspotmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).