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øiland-Jørgensen wrote: >>>> "Paul E. McKenney" writes: >>>> >>>>> On Sat, Jun 26, 2021 at 12:00:55PM +0200, Toke Høiland-Jø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 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 (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=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 >> CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' W=1 ARCH=ia64 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 > > OK, we really are running the same sparse. And even the same gcc. > > I did only a "make defconfig" followed by a "C=2" native build > on x86. Is your "ARCH=ia64" 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=16 C=1 CF=-fdiagnostic-prefix -D__CHECK_ENDIAN__ W=1 ARCH=x86_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