From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============4327559614129375266==" 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: Tue, 29 Jun 2021 16:47:17 +0800 Message-ID: In-Reply-To: <20210628225357.GM4397@paulmck-ThinkPad-P17-Gen-1> List-Id: --===============4327559614129375266== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=B8rgense= n wrote: >> "Paul E. McKenney" writes: >> >>> On Sat, Jun 26, 2021 at 12:00:55PM +0200, Toke H=C3=B8iland-J=C3=B8rgen= sen 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 errors >>> 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 (diff= erent 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] __r= cu * >>> kernel/bpf/devmap.c:657:29: warning: incorrect type in assignment (diff= erent 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] __r= cu * >> >> 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/bpf/ ... 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 * 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 Best Regards, Rong Chen --===============4327559614129375266==--