tree:
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 5fcb9628fd1227a5f11d87171cb1b8b5c414d9d9
commit: b7b7b429e0c55dce39fdfc2a2a447f63ca5b412b [1332/2089] parisc: Prevent optimization
of loads and stores in atomic operations
config: parisc-randconfig-s031-20200617 (attached as .config)
compiler: hppa-linux-gcc (GCC) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.2-rc1-6-g78f577f8-dirty
git checkout b7b7b429e0c55dce39fdfc2a2a447f63ca5b412b
# save the attached .config to linux build tree
make W=1 C=1 ARCH=parisc CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
> arch/parisc/include/asm/futex.h:107:34: sparse: sparse: incorrect
type in argument 1 (different modifiers) @@ expected unsigned int [noderef] [usertype]
<asn:1> *uaddr @@ got unsigned int volatile [noderef] [usertype] <asn:1>
*u @@
> arch/parisc/include/asm/futex.h:107:34: sparse: expected unsigned int [noderef]
[usertype] <asn:1> *uaddr
> arch/parisc/include/asm/futex.h:107:34: sparse: got unsigned int volatile
[noderef] [usertype] <asn:1> *u
arch/parisc/include/asm/futex.h:109:47:
sparse: sparse: incorrect type in argument 1 (different modifiers) @@ expected
unsigned int [noderef] [usertype] <asn:1> *uaddr @@ got unsigned int volatile
[noderef] [usertype] <asn:1> *u @@
arch/parisc/include/asm/futex.h:109:47: sparse: expected unsigned int [noderef]
[usertype] <asn:1> *uaddr
arch/parisc/include/asm/futex.h:109:47: sparse: got unsigned int volatile [noderef]
[usertype] <asn:1> *u
arch/parisc/include/asm/futex.h:114:47: sparse: sparse: incorrect type in argument 1
(different modifiers) @@ expected unsigned int [noderef] [usertype] <asn:1>
*uaddr @@ got unsigned int volatile [noderef] [usertype] <asn:1> *u @@
arch/parisc/include/asm/futex.h:114:47: sparse: expected unsigned int [noderef]
[usertype] <asn:1> *uaddr
arch/parisc/include/asm/futex.h:114:47: sparse: got unsigned int volatile [noderef]
[usertype] <asn:1> *u
arch/parisc/include/asm/futex.h:119:39: sparse: sparse: incorrect type in argument 1
(different modifiers) @@ expected unsigned int [noderef] [usertype] <asn:1>
*uaddr @@ got unsigned int volatile [noderef] [usertype] <asn:1> *u @@
arch/parisc/include/asm/futex.h:119:39: sparse: expected unsigned int [noderef]
[usertype] <asn:1> *uaddr
arch/parisc/include/asm/futex.h:119:39: sparse: got unsigned int volatile [noderef]
[usertype] <asn:1> *u
arch/parisc/include/asm/futex.h:19:24: sparse: sparse: cast removes address space
'<asn:1>' of expression
arch/parisc/include/asm/futex.h:29:24: sparse: sparse: cast removes address space
'<asn:1>' of expression
arch/parisc/include/asm/futex.h:29:24: sparse: sparse: cast removes address space
'<asn:1>' of expression
arch/parisc/include/asm/futex.h:29:24: sparse: sparse: cast removes address space
'<asn:1>' of expression
kernel/futex.c:1562:9: sparse: sparse: context imbalance in 'wake_futex_pi' -
unexpected unlock
arch/parisc/include/asm/futex.h:43:34: sparse: sparse: incorrect type in argument 1
(different modifiers) @@ expected unsigned int [noderef] [usertype] <asn:1>
*uaddr @@ got unsigned int volatile [noderef] [usertype] <asn:1> *u @@
arch/parisc/include/asm/futex.h:43:34: sparse: expected unsigned int [noderef]
[usertype] <asn:1> *uaddr
arch/parisc/include/asm/futex.h:43:34: sparse: got unsigned int volatile [noderef]
[usertype] <asn:1> *u
arch/parisc/include/asm/futex.h:76:39: sparse: sparse: incorrect type in argument 1
(different modifiers) @@ expected unsigned int [noderef] [usertype] <asn:1>
*uaddr @@ got unsigned int volatile [noderef] [usertype] <asn:1> *u @@
arch/parisc/include/asm/futex.h:76:39: sparse: expected unsigned int [noderef]
[usertype] <asn:1> *uaddr
arch/parisc/include/asm/futex.h:76:39: sparse: got unsigned int volatile [noderef]
[usertype] <asn:1> *u
arch/parisc/include/asm/futex.h:19:24: sparse: sparse: cast removes address space
'<asn:1>' of expression
arch/parisc/include/asm/futex.h:29:24: sparse: sparse: cast removes address space
'<asn:1>' of expression
kernel/futex.c:1721:33: sparse: sparse: context imbalance in 'futex_wake_op' -
different lock contexts for basic block
arch/parisc/include/asm/atomic.h:127:1: sparse: sparse: context imbalance in
'futex_requeue' - different lock contexts for basic block
kernel/futex.c:2495:9: sparse: sparse: context imbalance in
'fixup_pi_state_owner' - unexpected unlock
kernel/futex.c:2604:13: sparse: sparse: context imbalance in
'futex_wait_queue_me' - unexpected unlock
kernel/futex.c:2706:1: sparse: sparse: context imbalance in 'futex_wait_setup'
- different lock contexts for basic block
kernel/futex.c:2994:12: sparse: sparse: context imbalance in 'futex_unlock_pi'
- different lock contexts for basic block
kernel/futex.c:3272:29: sparse: sparse: context imbalance in
'futex_wait_requeue_pi' - unexpected unlock
vim +107 arch/parisc/include/asm/futex.h
83
84 static inline int
85 futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
86 u32 oldval, u32 newval)
87 {
88 u32 val;
89 unsigned long flags;
90 volatile u32 __user *u = uaddr;
91
92 /* futex.c wants to do a cmpxchg_inatomic on kernel NULL, which is
93 * our gateway page, and causes no end of trouble...
94 */
95 if (uaccess_kernel() && !u)
96 return -EFAULT;
97
98 if (!access_ok(u, sizeof(u32)))
99 return -EFAULT;
100
101 /* HPPA has no cmpxchg in hardware and therefore the
102 * best we can do here is use an array of locks. The
103 * lock selected is based on a hash of the userspace
104 * address. This should scale to a couple of CPUs.
105 */
106
107 _futex_spin_lock_irqsave(u, &flags);
108 if
(unlikely(get_user(val, u) != 0)) {
109 _futex_spin_unlock_irqrestore(u, &flags);
110 return -EFAULT;
111 }
112
113 if (val == oldval && unlikely(put_user(newval, u) != 0)) {
114 _futex_spin_unlock_irqrestore(u, &flags);
115 return -EFAULT;
116 }
117
118 *uval = val;
119 _futex_spin_unlock_irqrestore(u, &flags);
120
121 return 0;
122 }
123
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org