bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Brendan Jackman <jackmanb@google.com>, bpf@vger.kernel.org
Cc: kbuild-all@lists.01.org, Alexei Starovoitov <ast@kernel.org>,
	Yonghong Song <yhs@fb.com>,
	Daniel Borkmann <daniel@iogearbox.net>,
	KP Singh <kpsingh@chromium.org>,
	Florent Revest <revest@chromium.org>,
	Brendan Jackman <jackmanb@google.com>
Subject: Re: [PATCH 5/7] bpf: Add BPF_FETCH field / create atomic_fetch_add instruction
Date: Tue, 24 Nov 2020 05:12:34 +0800	[thread overview]
Message-ID: <202011240539.CCQu7xcD-lkp@intel.com> (raw)
In-Reply-To: <20201123173202.1335708-6-jackmanb@google.com>

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

Hi Brendan,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on bpf-next/master]
[also build test WARNING on bpf/master powerpc/next linus/master v5.10-rc5 next-20201123]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Brendan-Jackman/Atomics-for-eBPF/20201124-013549
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
config: arc-randconfig-s031-20201123 (attached as .config)
compiler: arc-elf-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.3-134-gb59dbdaf-dirty
        # https://github.com/0day-ci/linux/commit/b2b5923320904ef8c33183e8e88042588eb99397
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Brendan-Jackman/Atomics-for-eBPF/20201124-013549
        git checkout b2b5923320904ef8c33183e8e88042588eb99397
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=arc 

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


"sparse warnings: (new ones prefixed by >>)"
   kernel/bpf/core.c:209:49: sparse: sparse: arithmetics on pointers to functions
   kernel/bpf/core.c:1521:43: sparse: sparse: arithmetics on pointers to functions
   kernel/bpf/core.c:1526:48: sparse: sparse: arithmetics on pointers to functions
   kernel/bpf/core.c:1742:77: sparse: sparse: subtraction of functions? Share your drugs
   kernel/bpf/core.c: note: in included file (through include/trace/trace_events.h, include/trace/define_trace.h, include/trace/events/xdp.h, ...):
   include/trace/events/xdp.h:308:1: sparse: sparse: Using plain integer as NULL pointer
   include/trace/events/xdp.h:335:1: sparse: sparse: Using plain integer as NULL pointer
   include/trace/events/xdp.h:369:1: sparse: sparse: Using plain integer as NULL pointer
>> kernel/bpf/core.c:1656:60: sparse: sparse: non size-preserving integer to pointer cast

vim +1656 kernel/bpf/core.c

  1628	
  1629		STX_ATOMIC_W:
  1630			switch (IMM) {
  1631			case BPF_ADD:
  1632				/* lock xadd *(u32 *)(dst_reg + off16) += src_reg */
  1633				atomic_add((u32) SRC, (atomic_t *)(unsigned long)
  1634					   (DST + insn->off));
  1635				break;
  1636			case BPF_ADD | BPF_FETCH:
  1637				SRC = (u32) atomic_fetch_add(
  1638					(u32) SRC,
  1639					(atomic_t *)(unsigned long) (DST + insn->off));
  1640				break;
  1641			default:
  1642				goto default_label;
  1643			}
  1644			CONT;
  1645	
  1646		STX_ATOMIC_DW:
  1647			switch (IMM) {
  1648			case BPF_ADD:
  1649				/* lock xadd *(u64 *)(dst_reg + off16) += src_reg */
  1650				atomic64_add((u64) SRC, (atomic64_t *)(unsigned long)
  1651					     (DST + insn->off));
  1652				break;
  1653			case BPF_ADD | BPF_FETCH:
  1654				SRC = (u64) atomic64_fetch_add(
  1655					(u64) SRC,
> 1656					(atomic64_t *)(s64) (DST + insn->off));
  1657				break;
  1658			default:
  1659				goto default_label;
  1660			}
  1661			CONT;
  1662	
  1663		default_label:
  1664			/* If we ever reach this, we have a bug somewhere. Die hard here
  1665			 * instead of just returning 0; we could be somewhere in a subprog,
  1666			 * so execution could continue otherwise which we do /not/ want.
  1667			 *
  1668			 * Note, verifier whitelists all opcodes in bpf_opcode_in_insntable().
  1669			 */
  1670			pr_warn("BPF interpreter: unknown opcode %02x (imm: 0x%x)\n",
  1671				insn->code, insn->imm);
  1672			BUG_ON(1);
  1673			return 0;
  1674	}
  1675	

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

  reply	other threads:[~2020-11-23 21:12 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-23 17:31 [PATCH 0/7] Atomics for eBPF Brendan Jackman
2020-11-23 17:31 ` [PATCH 1/7] bpf: Factor out emission of ModR/M for *(reg + off) Brendan Jackman
2020-11-23 17:31 ` [PATCH 2/7] bpf: x86: Factor out emission of REX byte Brendan Jackman
2020-11-23 17:31 ` [PATCH 3/7] bpf: Rename BPF_XADD and prepare to encode other atomics in .imm Brendan Jackman
2020-11-23 23:54   ` Yonghong Song
2020-11-24 11:02     ` Brendan Jackman
2020-11-24 16:04       ` Yonghong Song
2020-11-24  3:28   ` kernel test robot
2020-11-24  6:50   ` Alexei Starovoitov
2020-11-24 11:21     ` Brendan Jackman
2020-11-24 22:43       ` Alexei Starovoitov
2020-11-23 17:31 ` [PATCH 4/7] bpf: Move BPF_STX reserved field check into BPF_STX verifier code Brendan Jackman
2020-11-23 17:32 ` [PATCH 5/7] bpf: Add BPF_FETCH field / create atomic_fetch_add instruction Brendan Jackman
2020-11-23 21:12   ` kernel test robot [this message]
2020-11-23 21:51   ` kernel test robot
2020-11-24  6:52   ` Alexei Starovoitov
2020-11-24 10:48     ` Brendan Jackman
2020-11-23 17:32 ` [PATCH 6/7] bpf: Add instructions for atomic_cmpxchg and friends Brendan Jackman
2020-11-23 19:29   ` Brendan Jackman
2020-11-24  6:40   ` Alexei Starovoitov
2020-11-24 10:55     ` Brendan Jackman
2020-11-24 22:51       ` Alexei Starovoitov
2020-11-23 17:32 ` [PATCH 7/7] bpf: Add tests for new BPF atomic operations Brendan Jackman
2020-11-24  0:26   ` Yonghong Song
2020-11-24 13:10     ` Brendan Jackman
2020-11-23 17:36 ` [PATCH 0/7] Atomics for eBPF Brendan Jackman

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=202011240539.CCQu7xcD-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=jackmanb@google.com \
    --cc=kbuild-all@lists.01.org \
    --cc=kpsingh@chromium.org \
    --cc=revest@chromium.org \
    --cc=yhs@fb.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).