[peterz-queue:x86/wip.ibt 22/42] kernel/bpf/trampoline.c:154:33: sparse: sparse: incorrect type in argument 1 (different base types)

From: kernel test robot
Date: Wed Feb 23 2022 - 23:04:10 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git x86/wip.ibt
head: 27b6438f414b6a37b60dcd90c8980397586d49db
commit: 28a2850ec958722056cb6679cf68567905223971 [22/42] x86/bpf: Add ENDBR instructions to prologue and trampoline
config: sparc-randconfig-s031-20220224 (https://download.01.org/0day-ci/archive/20220224/202202241239.Qn6Kniwo-lkp@xxxxxxxxx/config)
compiler: sparc-linux-gcc (GCC) 11.2.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.4-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/commit/?id=28a2850ec958722056cb6679cf68567905223971
git remote add peterz-queue https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git
git fetch --no-tags peterz-queue x86/wip.ibt
git checkout 28a2850ec958722056cb6679cf68567905223971
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=sparc SHELL=/bin/bash kernel/bpf/

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


sparse warnings: (new ones prefixed by >>)
>> kernel/bpf/trampoline.c:154:33: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned long ip @@ got void *ip @@
kernel/bpf/trampoline.c:154:33: sparse: expected unsigned long ip
kernel/bpf/trampoline.c:154:33: sparse: got void *ip

vim +154 kernel/bpf/trampoline.c

146
147 /* first time registering */
148 static int register_fentry(struct bpf_trampoline *tr, void *new_addr)
149 {
150 void *ip = tr->func.addr;
151 unsigned long faddr;
152 int ret;
153
> 154 faddr = ftrace_location(ip);
155 if (faddr)
156 tr->func.ftrace_managed = true;
157
158 if (bpf_trampoline_module_get(tr))
159 return -ENOENT;
160
161 if (tr->func.ftrace_managed)
162 ret = register_ftrace_direct((long)ip, (long)new_addr);
163 else
164 ret = bpf_arch_text_poke(ip, BPF_MOD_CALL, NULL, new_addr);
165
166 if (ret)
167 bpf_trampoline_module_put(tr);
168 return ret;
169 }
170

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx