From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============2806885342274186708==" MIME-Version: 1.0 From: Chen, Rong A 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: Wed, 30 Jun 2021 15:31:57 +0800 Message-ID: <731df9e2-1db0-652d-d4ce-59cd5a4ad3b4@intel.com> In-Reply-To: <20210629165751.GQ4397@paulmck-ThinkPad-P17-Gen-1> List-Id: --===============2806885342274186708== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On 6/30/2021 12:57 AM, Paul E. McKenney wrote: > 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=B8rg= ensen wrote: >>>>>> +Paul - any idea why unrcu_pointer() isn't working here? >>>>> >>>>> Hello, Toke! >>>>> >>>>> My distro version of sparse core-dumped before getting that far along. >>>>> >>>>> I cloned and built the latest version, and got only the following err= ors >>>>> 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 (di= fferent 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 (di= fferent 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/b= pf/ >> ... >> 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 *= dst >> kernel/bpf/devmap.c:561:29: sparse: got struct bpf_dtab_netdev [noder= ef] >> __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 *= dst >> kernel/bpf/devmap.c:657:29: sparse: got struct bpf_dtab_netdev [noder= ef] >> __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 > = Hi Paul, I can't get the error on x86: $ make --jobs=3D16 C=3D1 CF=3D-fdiagnostic-prefix -D__CHECK_ENDIAN__ W=3D1 = ARCH=3Dx86_64 kernel/bpf/ DESCEND objtool CALL scripts/atomic/check-atomics.sh CALL scripts/checksyscalls.sh CC kernel/bpf/devmap.o CHECK kernel/bpf/devmap.c 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 *dst kernel/bpf/devmap.c:561:29: sparse: got struct bpf_dtab_netdev = [noderef] __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 *dst kernel/bpf/devmap.c:657:29: sparse: got struct bpf_dtab_netdev = [noderef] __rcu * AR kernel/bpf/built-in.a Best Regards, Rong Chen --===============2806885342274186708==--