kernel/bpf/rqspinlock.c:100:39: sparse: sparse: incorrect type in initializer (different address spaces)

From: kernel test robot

Date: Sun Feb 15 2026 - 22:14:32 EST


Hi Kumar,

First bad commit (maybe != root cause):

tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 26a4cfaff82a2dcb810f6bfd5f4842f9b6046c8a
commit: e2082e32fd57976e811086708043c136ee596978 rqspinlock: Add entry to Makefile, MAINTAINERS
date: 11 months ago
config: x86_64-randconfig-121-20260216 (https://download.01.org/0day-ci/archive/20260216/202602161139.B1owy5fU-lkp@xxxxxxxxx/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260216/202602161139.B1owy5fU-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202602161139.B1owy5fU-lkp@xxxxxxxxx/

sparse warnings: (new ones prefixed by >>)
>> kernel/bpf/rqspinlock.c:100:39: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got struct rqspinlock_held * @@
kernel/bpf/rqspinlock.c:100:39: sparse: expected void const [noderef] __percpu *__vpp_verify
kernel/bpf/rqspinlock.c:100:39: sparse: got struct rqspinlock_held *
kernel/bpf/rqspinlock.c:122:39: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got struct rqspinlock_held * @@
kernel/bpf/rqspinlock.c:122:39: sparse: expected void const [noderef] __percpu *__vpp_verify
kernel/bpf/rqspinlock.c:122:39: sparse: got struct rqspinlock_held *
kernel/bpf/rqspinlock.c:135:51: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got struct rqspinlock_held * @@
kernel/bpf/rqspinlock.c:135:51: sparse: expected void const [noderef] __percpu *__vpp_verify
kernel/bpf/rqspinlock.c:135:51: sparse: got struct rqspinlock_held *

vim +100 kernel/bpf/rqspinlock.c

31158ad02ddbed Kumar Kartikeya Dwivedi 2025-03-15 96
31158ad02ddbed Kumar Kartikeya Dwivedi 2025-03-15 97 static noinline int check_deadlock_AA(rqspinlock_t *lock, u32 mask,
31158ad02ddbed Kumar Kartikeya Dwivedi 2025-03-15 98 struct rqspinlock_timeout *ts)
31158ad02ddbed Kumar Kartikeya Dwivedi 2025-03-15 99 {
31158ad02ddbed Kumar Kartikeya Dwivedi 2025-03-15 @100 struct rqspinlock_held *rqh = this_cpu_ptr(&rqspinlock_held_locks);
31158ad02ddbed Kumar Kartikeya Dwivedi 2025-03-15 101 int cnt = min(RES_NR_HELD, rqh->cnt);
31158ad02ddbed Kumar Kartikeya Dwivedi 2025-03-15 102
31158ad02ddbed Kumar Kartikeya Dwivedi 2025-03-15 103 /*
31158ad02ddbed Kumar Kartikeya Dwivedi 2025-03-15 104 * Return an error if we hold the lock we are attempting to acquire.
31158ad02ddbed Kumar Kartikeya Dwivedi 2025-03-15 105 * We'll iterate over max 32 locks; no need to do is_lock_released.
31158ad02ddbed Kumar Kartikeya Dwivedi 2025-03-15 106 */
31158ad02ddbed Kumar Kartikeya Dwivedi 2025-03-15 107 for (int i = 0; i < cnt - 1; i++) {
31158ad02ddbed Kumar Kartikeya Dwivedi 2025-03-15 108 if (rqh->locks[i] == lock)
31158ad02ddbed Kumar Kartikeya Dwivedi 2025-03-15 109 return -EDEADLK;
31158ad02ddbed Kumar Kartikeya Dwivedi 2025-03-15 110 }
31158ad02ddbed Kumar Kartikeya Dwivedi 2025-03-15 111 return 0;
31158ad02ddbed Kumar Kartikeya Dwivedi 2025-03-15 112 }
31158ad02ddbed Kumar Kartikeya Dwivedi 2025-03-15 113

:::::: The code at line 100 was first introduced by commit
:::::: 31158ad02ddbed2b0672c9701a0a2f3e5b3bc01a rqspinlock: Add deadlock detection and recovery

:::::: TO: Kumar Kartikeya Dwivedi <memxor@xxxxxxxxx>
:::::: CC: Alexei Starovoitov <ast@xxxxxxxxxx>

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki