lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <201904262228.mgpruSBE%lkp@intel.com>
Date:   Fri, 26 Apr 2019 22:09:42 +0800
From:   kbuild test robot <lkp@...el.com>
To:     Martin KaFai Lau <kafai@...com>
Cc:     kbuild-all@...org, bpf@...r.kernel.org, netdev@...r.kernel.org,
        Alexei Starovoitov <ast@...com>,
        Andrii Nakryiko <andriin@...com>,
        Daniel Borkmann <daniel@...earbox.net>,
        John Fastabend <john.fastabend@...il.com>, kernel-team@...com,
        Yonghong Song <yhs@...com>
Subject: Re: [PATCH v2 bpf-next 1/6] bpf: Introduce bpf sk local storage

Hi Martin,

I love your patch! Yet something to improve:

[auto build test ERROR on bpf-next/master]

url:    https://github.com/0day-ci/linux/commits/Martin-KaFai-Lau/bpf-Introduce-bpf-sk-local-storage/20190426-192951
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
config: arm64-allyesconfig (attached as .config)
compiler: aarch64-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.2.0 make.cross ARCH=arm64 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@...el.com>

All error/warnings (new ones prefixed by >>):

   In file included from arch/arm64/include/asm/spinlock_types.h:23:0,
                    from include/linux/spinlock_types.h:13,
                    from net//core/bpf_sk_storage.c:3:
>> include/asm-generic/qspinlock_types.h:33:3: error: unknown type name 'atomic_t'
      atomic_t val;
      ^~~~~~~~
>> include/asm-generic/qspinlock_types.h:51:4: error: unknown type name 'u16'
       u16 tail;
       ^~~
   include/asm-generic/qspinlock_types.h:52:4: error: unknown type name 'u16'
       u16 locked_pending;
       ^~~
>> include/asm-generic/qspinlock_types.h:55:4: error: unknown type name 'u8'
       u8 reserved[2];
       ^~
   include/asm-generic/qspinlock_types.h:56:4: error: unknown type name 'u8'
       u8 pending;
       ^~
   include/asm-generic/qspinlock_types.h:57:4: error: unknown type name 'u8'
       u8 locked;
       ^~
   In file included from ./arch/arm64/include/generated/asm/qspinlock.h:1:0,
                    from arch/arm64/include/asm/spinlock.h:20,
                    from include/linux/spinlock.h:88,
                    from include/linux/seqlock.h:36,
                    from include/linux/time.h:6,
                    from include/linux/ktime.h:24,
                    from include/linux/timer.h:6,
                    from include/linux/workqueue.h:9,
                    from include/linux/bpf.h:12,
                    from net//core/bpf_sk_storage.c:8:
   include/asm-generic/qspinlock.h: In function 'queued_spin_is_locked':
>> include/asm-generic/qspinlock.h:35:21: error: passing argument 1 of 'atomic_read' from incompatible pointer type [-Werror=incompatible-pointer-types]
     return atomic_read(&lock->val);
                        ^
   In file included from arch/arm64/include/asm/atomic.h:169:0,
                    from include/linux/atomic.h:7,
                    from include/asm-generic/bitops/atomic.h:5,
                    from arch/arm64/include/asm/bitops.h:37,
                    from include/linux/bitops.h:19,
                    from include/linux/kernel.h:12,
                    from include/linux/list.h:9,
                    from include/linux/lockdep.h:27,
                    from include/linux/spinlock_types.h:18,
                    from net//core/bpf_sk_storage.c:3:
   include/asm-generic/atomic-instrumented.h:24:1: note: expected 'const atomic_t * {aka const struct <anonymous> *}' but argument is of type 'int *'
    atomic_read(const atomic_t *v)
    ^~~~~~~~~~~
   In file included from ./arch/arm64/include/generated/asm/qspinlock.h:1:0,
                    from arch/arm64/include/asm/spinlock.h:20,
                    from include/linux/spinlock.h:88,
                    from include/linux/seqlock.h:36,
                    from include/linux/time.h:6,
                    from include/linux/ktime.h:24,
                    from include/linux/timer.h:6,
                    from include/linux/workqueue.h:9,
                    from include/linux/bpf.h:12,
                    from net//core/bpf_sk_storage.c:8:
   include/asm-generic/qspinlock.h: In function 'queued_spin_value_unlocked':
   include/asm-generic/qspinlock.h:50:22: error: passing argument 1 of 'atomic_read' from incompatible pointer type [-Werror=incompatible-pointer-types]
     return !atomic_read(&lock.val);
                         ^
   In file included from arch/arm64/include/asm/atomic.h:169:0,
                    from include/linux/atomic.h:7,
                    from include/asm-generic/bitops/atomic.h:5,
                    from arch/arm64/include/asm/bitops.h:37,
                    from include/linux/bitops.h:19,
                    from include/linux/kernel.h:12,
                    from include/linux/list.h:9,
                    from include/linux/lockdep.h:27,
                    from include/linux/spinlock_types.h:18,
                    from net//core/bpf_sk_storage.c:3:
   include/asm-generic/atomic-instrumented.h:24:1: note: expected 'const atomic_t * {aka const struct <anonymous> *}' but argument is of type 'int *'
    atomic_read(const atomic_t *v)
    ^~~~~~~~~~~
   In file included from ./arch/arm64/include/generated/asm/qspinlock.h:1:0,
                    from arch/arm64/include/asm/spinlock.h:20,
                    from include/linux/spinlock.h:88,
                    from include/linux/seqlock.h:36,
                    from include/linux/time.h:6,
                    from include/linux/ktime.h:24,
                    from include/linux/timer.h:6,
                    from include/linux/workqueue.h:9,
                    from include/linux/bpf.h:12,
                    from net//core/bpf_sk_storage.c:8:
   include/asm-generic/qspinlock.h: In function 'queued_spin_is_contended':
   include/asm-generic/qspinlock.h:60:21: error: passing argument 1 of 'atomic_read' from incompatible pointer type [-Werror=incompatible-pointer-types]
     return atomic_read(&lock->val) & ~_Q_LOCKED_MASK;
                        ^
   In file included from arch/arm64/include/asm/atomic.h:169:0,
                    from include/linux/atomic.h:7,
                    from include/asm-generic/bitops/atomic.h:5,
                    from arch/arm64/include/asm/bitops.h:37,
                    from include/linux/bitops.h:19,
                    from include/linux/kernel.h:12,
                    from include/linux/list.h:9,
                    from include/linux/lockdep.h:27,
                    from include/linux/spinlock_types.h:18,
                    from net//core/bpf_sk_storage.c:3:
   include/asm-generic/atomic-instrumented.h:24:1: note: expected 'const atomic_t * {aka const struct <anonymous> *}' but argument is of type 'int *'
    atomic_read(const atomic_t *v)
    ^~~~~~~~~~~
   In file included from ./arch/arm64/include/generated/asm/qspinlock.h:1:0,
                    from arch/arm64/include/asm/spinlock.h:20,
                    from include/linux/spinlock.h:88,
                    from include/linux/seqlock.h:36,
                    from include/linux/time.h:6,
                    from include/linux/ktime.h:24,
                    from include/linux/timer.h:6,
                    from include/linux/workqueue.h:9,
                    from include/linux/bpf.h:12,
                    from net//core/bpf_sk_storage.c:8:
   include/asm-generic/qspinlock.h: In function 'queued_spin_trylock':
   include/asm-generic/qspinlock.h:69:24: error: passing argument 1 of 'atomic_read' from incompatible pointer type [-Werror=incompatible-pointer-types]
     u32 val = atomic_read(&lock->val);
                           ^
   In file included from arch/arm64/include/asm/atomic.h:169:0,
                    from include/linux/atomic.h:7,
                    from include/asm-generic/bitops/atomic.h:5,
                    from arch/arm64/include/asm/bitops.h:37,
                    from include/linux/bitops.h:19,
                    from include/linux/kernel.h:12,
                    from include/linux/list.h:9,
                    from include/linux/lockdep.h:27,
                    from include/linux/spinlock_types.h:18,
                    from net//core/bpf_sk_storage.c:3:
   include/asm-generic/atomic-instrumented.h:24:1: note: expected 'const atomic_t * {aka const struct <anonymous> *}' but argument is of type 'int *'
    atomic_read(const atomic_t *v)
    ^~~~~~~~~~~
   In file included from include/uapi/linux/swab.h:6:0,
                    from include/linux/swab.h:5,
                    from include/uapi/linux/byteorder/big_endian.h:13,
                    from include/linux/byteorder/big_endian.h:5,
                    from arch/arm64/include/uapi/asm/byteorder.h:21,
                    from include/asm-generic/qrwlock_types.h:6,
                    from arch/arm64/include/asm/spinlock_types.h:24,
                    from include/linux/spinlock_types.h:13,
                    from net//core/bpf_sk_storage.c:3:
>> include/asm-generic/qspinlock.h:74:43: error: passing argument 1 of 'atomic_try_cmpxchg_acquire' from incompatible pointer type [-Werror=incompatible-pointer-types]
     return likely(atomic_try_cmpxchg_acquire(&lock->val, &val, _Q_LOCKED_VAL));
                                              ^
   include/linux/compiler.h:76:40: note: in definition of macro 'likely'
    # define likely(x) __builtin_expect(!!(x), 1)
                                           ^
   In file included from include/linux/atomic.h:74:0,
                    from include/asm-generic/bitops/atomic.h:5,
                    from arch/arm64/include/asm/bitops.h:37,
                    from include/linux/bitops.h:19,
                    from include/linux/kernel.h:12,
                    from include/linux/list.h:9,
                    from include/linux/lockdep.h:27,
                    from include/linux/spinlock_types.h:18,
                    from net//core/bpf_sk_storage.c:3:
   include/linux/atomic-fallback.h:928:1: note: expected 'atomic_t * {aka struct <anonymous> *}' but argument is of type 'int *'
    atomic_try_cmpxchg_acquire(atomic_t *v, int *old, int new)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from include/uapi/linux/swab.h:6:0,
                    from include/linux/swab.h:5,
                    from include/uapi/linux/byteorder/big_endian.h:13,
                    from include/linux/byteorder/big_endian.h:5,
                    from arch/arm64/include/uapi/asm/byteorder.h:21,
                    from include/asm-generic/qrwlock_types.h:6,
                    from arch/arm64/include/asm/spinlock_types.h:24,
                    from include/linux/spinlock_types.h:13,
                    from net//core/bpf_sk_storage.c:3:
   include/asm-generic/qspinlock.h: In function 'queued_spin_lock':
   include/asm-generic/qspinlock.h:87:40: error: passing argument 1 of 'atomic_try_cmpxchg_acquire' from incompatible pointer type [-Werror=incompatible-pointer-types]
     if (likely(atomic_try_cmpxchg_acquire(&lock->val, &val, _Q_LOCKED_VAL)))
                                           ^
   include/linux/compiler.h:76:40: note: in definition of macro 'likely'
    # define likely(x) __builtin_expect(!!(x), 1)
                                           ^
   In file included from include/linux/atomic.h:74:0,
                    from include/asm-generic/bitops/atomic.h:5,
                    from arch/arm64/include/asm/bitops.h:37,
                    from include/linux/bitops.h:19,
                    from include/linux/kernel.h:12,
                    from include/linux/list.h:9,
                    from include/linux/lockdep.h:27,
                    from include/linux/spinlock_types.h:18,
                    from net//core/bpf_sk_storage.c:3:
   include/linux/atomic-fallback.h:928:1: note: expected 'atomic_t * {aka struct <anonymous> *}' but argument is of type 'int *'
    atomic_try_cmpxchg_acquire(atomic_t *v, int *old, int new)
    ^~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from include/linux/fs.h:25:0,
                    from include/linux/compat.h:17,
                    from include/linux/ethtool.h:17,
                    from include/linux/netdevice.h:41,
                    from include/net/sock.h:51,
                    from net//core/bpf_sk_storage.c:10:
   include/linux/semaphore.h: In function 'sema_init':
>> include/linux/semaphore.h:35:17: warning: braces around scalar initializer
     *sem = (struct semaphore) __SEMAPHORE_INITIALIZER(*sem, val);
                    ^~~~~~~~~
   include/linux/semaphore.h:35:17: note: (near initialization for '(anonymous).raw_lock.<anonymous>.val')
   cc1: some warnings being treated as errors

vim +/atomic_t +33 include/asm-generic/qspinlock_types.h

a33fda35 Waiman Long 2015-04-24  30  
a33fda35 Waiman Long 2015-04-24  31  typedef struct qspinlock {
625e88be Will Deacon 2018-04-26  32  	union {
a33fda35 Waiman Long 2015-04-24 @33  		atomic_t val;
625e88be Will Deacon 2018-04-26  34  
625e88be Will Deacon 2018-04-26  35  		/*
625e88be Will Deacon 2018-04-26  36  		 * By using the whole 2nd least significant byte for the
625e88be Will Deacon 2018-04-26  37  		 * pending bit, we can allow better optimization of the lock
625e88be Will Deacon 2018-04-26  38  		 * acquisition for the pending bit holder.
625e88be Will Deacon 2018-04-26  39  		 */
625e88be Will Deacon 2018-04-26  40  #ifdef __LITTLE_ENDIAN
625e88be Will Deacon 2018-04-26  41  		struct {
625e88be Will Deacon 2018-04-26  42  			u8	locked;
625e88be Will Deacon 2018-04-26  43  			u8	pending;
625e88be Will Deacon 2018-04-26  44  		};
625e88be Will Deacon 2018-04-26  45  		struct {
625e88be Will Deacon 2018-04-26  46  			u16	locked_pending;
625e88be Will Deacon 2018-04-26  47  			u16	tail;
625e88be Will Deacon 2018-04-26  48  		};
625e88be Will Deacon 2018-04-26  49  #else
625e88be Will Deacon 2018-04-26  50  		struct {
625e88be Will Deacon 2018-04-26 @51  			u16	tail;
625e88be Will Deacon 2018-04-26  52  			u16	locked_pending;
625e88be Will Deacon 2018-04-26  53  		};
625e88be Will Deacon 2018-04-26  54  		struct {
625e88be Will Deacon 2018-04-26 @55  			u8	reserved[2];
625e88be Will Deacon 2018-04-26  56  			u8	pending;
625e88be Will Deacon 2018-04-26  57  			u8	locked;
625e88be Will Deacon 2018-04-26  58  		};
625e88be Will Deacon 2018-04-26  59  #endif
625e88be Will Deacon 2018-04-26  60  	};
a33fda35 Waiman Long 2015-04-24  61  } arch_spinlock_t;
a33fda35 Waiman Long 2015-04-24  62  

:::::: The code at line 33 was first introduced by commit
:::::: a33fda35e3a7655fb7df756ed67822afb5ed5e8d locking/qspinlock: Introduce a simple generic 4-byte queued spinlock

:::::: TO: Waiman Long <Waiman.Long@...com>
:::::: CC: Ingo Molnar <mingo@...nel.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Download attachment ".config.gz" of type "application/gzip" (63211 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ