From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============6087769575019842101==" MIME-Version: 1.0 From: Paul E. McKenney To: kbuild-all@lists.01.org Subject: Re: [bpf-next:master 15/30] kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression Date: Tue, 29 Jun 2021 09:57:51 -0700 Message-ID: <20210629165751.GQ4397@paulmck-ThinkPad-P17-Gen-1> In-Reply-To: List-Id: --===============6087769575019842101== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On Tue, Jun 29, 2021 at 04:47:17PM +0800, Chen, Rong A wrote: > = > = > On 6/29/2021 6:53 AM, Paul E. McKenney wrote: > > On Tue, Jun 29, 2021 at 12:42:52AM +0200, Toke H=C3=B8iland-J=C3=B8rgen= sen wrote: > > > "Paul E. McKenney" writes: > > > = > > > > On Sat, Jun 26, 2021 at 12:00:55PM +0200, Toke H=C3=B8iland-J=C3=B8= rgensen wrote: > > > > > +Paul - any idea why unrcu_pointer() isn't working here? > > > > = > > > > Hello, Toke! > > > > = > > > > My distro version of sparse core-dumped before getting that far alo= ng. > > > > = > > > > I cloned and built the latest version, and got only the following e= rrors > > > > from kernel/bpf/devmap.c: > > > > = > > > > -------------------------------------------------------------------= ----- > > > > = > > > > CHECK scripts/mod/empty.c > > > > CALL scripts/checksyscalls.sh > > > > CALL scripts/atomic/check-atomics.sh > > > > DESCEND objtool > > > > CC kernel/bpf/devmap.o > > > > CHECK kernel/bpf/devmap.c > > > > kernel/bpf/devmap.c:561:29: warning: incorrect type in assignment (= different address spaces) > > > > kernel/bpf/devmap.c:561:29: expected struct bpf_dtab_netdev *dst > > > > kernel/bpf/devmap.c:561:29: got struct bpf_dtab_netdev [noderef]= __rcu * > > > > kernel/bpf/devmap.c:657:29: warning: incorrect type in assignment (= different address spaces) > > > > kernel/bpf/devmap.c:657:29: expected struct bpf_dtab_netdev *dst > > > > kernel/bpf/devmap.c:657:29: got struct bpf_dtab_netdev [noderef]= __rcu * > > > = > > > Hmm, but those shouldn't be there either. Seems I missed those when > > > rebasing, will send a follow-up patch... > > = > > Just check out different versions of sparse and average the results? ;= -) > > = > > Thanx, Paul > = > Hi Paul, > = > I tested the original attached config with the reproduce step, and I can > reproduce the warning: > = > $ COMPILER_INSTALL_PATH=3D$HOME/0day COMPILER=3Dgcc-9.3.0 make.cross C=3D1 > CF=3D'-fdiagnostic-prefix -D__CHECK_ENDIAN__' W=3D1 ARCH=3Dia64 kernel/bp= f/ > ... > kernel/bpf/devmap.c:561:29: sparse: warning: incorrect type in assignment > (different address spaces) > kernel/bpf/devmap.c:561:29: sparse: expected struct bpf_dtab_netdev *d= st > kernel/bpf/devmap.c:561:29: sparse: got struct bpf_dtab_netdev [nodere= f] > __rcu * > kernel/bpf/devmap.c:657:29: sparse: warning: incorrect type in assignment > (different address spaces) > kernel/bpf/devmap.c:657:29: sparse: expected struct bpf_dtab_netdev *d= st > kernel/bpf/devmap.c:657:29: sparse: got struct bpf_dtab_netdev [nodere= f] > __rcu * > kernel/bpf/devmap.c:1030:40: sparse: warning: cast removes address space > '__rcu' of expression > kernel/bpf/devmap.c:1030:40: sparse: warning: cast removes address space > '__rcu' of expression > kernel/bpf/devmap.c:1030:40: sparse: warning: cast removes address space > '__rcu' of expression > kernel/bpf/devmap.c:1030:40: sparse: warning: cast removes address space > '__rcu' of expression > kernel/bpf/devmap.c:1030:40: sparse: warning: cast removes address space > '__rcu' of expression > kernel/bpf/devmap.c:1030:40: sparse: warning: cast removes address space > '__rcu' of expression > kernel/bpf/devmap.c:1030:40: sparse: warning: cast removes address space > '__rcu' of expression > kernel/bpf/devmap.c:1030:40: sparse: warning: cast removes address space > '__rcu' of expression > kernel/bpf/devmap.c:1030:40: sparse: warning: cast removes address space > '__rcu' of expression > kernel/bpf/devmap.c:1030:40: sparse: warning: cast removes address space > '__rcu' of expression > kernel/bpf/devmap.c:1030:40: sparse: warning: cast removes address space > '__rcu' of expression > kernel/bpf/devmap.c:1030:40: sparse: warning: cast removes address space > '__rcu' of expression > kernel/bpf/devmap.c:1030:40: sparse: warning: cast removes address space > '__rcu' of expression > kernel/bpf/devmap.c:1030:40: sparse: warning: cast removes address space > '__rcu' of expression > kernel/bpf/devmap.c:1030:40: sparse: warning: cast removes address space > '__rcu' of expression > kernel/bpf/devmap.c:1030:40: sparse: warning: cast removes address space > '__rcu' of expression > = > and sparse is from latest master branch: > $ sparse --version > v0.6.3-341-g8af24329 OK, we really are running the same sparse. And even the same gcc. I did only a "make defconfig" followed by a "C=3D2" native build on x86. Is your "ARCH=3Dia64" required, or does sparse also get you these same errors on x86? Thanx, Paul --===============6087769575019842101==--