All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul E. McKenney <paulmck@kernel.org>
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 08:38:00 -0700	[thread overview]
Message-ID: <20210630153800.GY4397@paulmck-ThinkPad-P17-Gen-1> (raw)
In-Reply-To: <731df9e2-1db0-652d-d4ce-59cd5a4ad3b4@intel.com>

[-- Attachment #1: Type: text/plain, Size: 6428 bytes --]

On Wed, Jun 30, 2021 at 03:31:57PM +0800, Chen, Rong A wrote:
> 
> 
> 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" <paulmck@kernel.org> 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

This looks similar to what I saw, and I believe that Toke sent out a
patch for these.

So this is likely to be an architecture-specific bug in IA64, correct?

I was going to add the IA64 maintainers on CC, but:

IA64 (Itanium) PLATFORM
L:	linux-ia64(a)vger.kernel.org
S:	Orphan
F:	Documentation/ia64/
F:	arch/ia64/

Over to you in your role as an Intel employee!  ;-)

							Thanx, Paul

      reply	other threads:[~2021-06-30 15:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-26  8:41 [bpf-next:master 15/30] kernel/bpf/devmap.c:1030:40: sparse: sparse: cast removes address space '__rcu' of expression kernel test robot
2021-06-26 10:00 ` Toke Høiland-Jørgensen
2021-06-28 15:53   ` Paul E. McKenney
2021-06-28 22:42     ` Toke Høiland-Jørgensen
2021-06-28 22:53       ` Paul E. McKenney
2021-06-29  8:47         ` Chen, Rong A
2021-06-29 16:57           ` Paul E. McKenney
2021-06-30  7:31             ` Chen, Rong A
2021-06-30 15:38               ` Paul E. McKenney [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210630153800.GY4397@paulmck-ThinkPad-P17-Gen-1 \
    --to=paulmck@kernel.org \
    --cc=kbuild-all@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.