All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Qais Yousef <qais.yousef@arm.com>
Cc: Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>, Jiri Olsa <jolsa@kernel.org>,
	netdev@vger.kernel.org, bpf@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Arnaldo Carvalho de Melo <acme@kernel.org>
Subject: Re: BTFIDS: FAILED unresolved symbol udp6_sock
Date: Wed, 30 Dec 2020 14:27:59 +0100	[thread overview]
Message-ID: <20201230132759.GB577428@krava> (raw)
In-Reply-To: <20201230090333.GA577428@krava>

On Wed, Dec 30, 2020 at 10:03:37AM +0100, Jiri Olsa wrote:
> On Tue, Dec 29, 2020 at 11:28:35PM +0000, Qais Yousef wrote:
> > Hi Jiri
> > 
> > On 12/29/20 18:34, Jiri Olsa wrote:
> > > On Tue, Dec 29, 2020 at 03:13:52PM +0000, Qais Yousef wrote:
> > > > Hi
> > > > 
> > > > When I enable CONFIG_DEBUG_INFO_BTF I get the following error in the BTFIDS
> > > > stage
> > > > 
> > > > 	FAILED unresolved symbol udp6_sock
> > > > 
> > > > I cross compile for arm64. My .config is attached.
> > > > 
> > > > I managed to reproduce the problem on v5.9 and v5.10. Plus 5.11-rc1.
> > > > 
> > > > Have you seen this before? I couldn't find a specific report about this
> > > > problem.
> > > > 
> > > > Let me know if you need more info.
> > > 
> > > hi,
> > > this looks like symptom of the gcc DWARF bug we were
> > > dealing with recently:
> > > 
> > >   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97060
> > >   https://lore.kernel.org/lkml/CAE1WUT75gu9G62Q9uAALGN6vLX=o7vZ9uhqtVWnbUV81DgmFPw@mail.gmail.com/#r
> > > 
> > > what pahole/gcc version are you using?
> > 
> > I'm on gcc 9.3.0
> > 
> > 	aarch64-linux-gnu-gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
> > 
> > I was on pahole v1.17. I moved to v1.19 but I still see the same problem.
> 
> I can reproduce with your .config, but make 'defconfig' works,
> so I guess it's some config option issue, I'll check later today

so your .config has
  CONFIG_CRYPTO_DEV_BCM_SPU=y

and that defines 'struct device_private' which
clashes with the same struct defined in drivers/base/base.h

so several networking structs will be doubled, like net_device:

	$ bpftool btf dump file ../vmlinux.config | grep net_device\' | grep STRUCT
	[2731] STRUCT 'net_device' size=2240 vlen=133
	[113981] STRUCT 'net_device' size=2240 vlen=133

each is using different 'struct device_private' when it's unwinded

and that will confuse BTFIDS logic, becase we have multiple structs
with the same name, and we can't be sure which one to pick

perhaps we should check on this in pahole and warn earlier with
better error message.. I'll check, but I'm not sure if pahole can
survive another hastab ;-)

Andrii, any ideas on this? ;-)

easy fix is the patch below that renames the bcm's structs,
it makes the kernel to compile.. but of course the new name
is probably wrong and we should push this through that code
authors

jirka


---
diff --git a/drivers/crypto/bcm/cipher.c b/drivers/crypto/bcm/cipher.c
index 30390a7324b2..0e5537838ef3 100644
--- a/drivers/crypto/bcm/cipher.c
+++ b/drivers/crypto/bcm/cipher.c
@@ -42,7 +42,7 @@
 
 /* ================= Device Structure ================== */
 
-struct device_private iproc_priv;
+struct bcm_device_private iproc_priv;
 
 /* ==================== Parameters ===================== */
 
diff --git a/drivers/crypto/bcm/cipher.h b/drivers/crypto/bcm/cipher.h
index 0ad5892b445d..71281a3bdbdc 100644
--- a/drivers/crypto/bcm/cipher.h
+++ b/drivers/crypto/bcm/cipher.h
@@ -420,7 +420,7 @@ struct spu_hw {
 	u32 num_chan;
 };
 
-struct device_private {
+struct bcm_device_private {
 	struct platform_device *pdev;
 
 	struct spu_hw spu;
@@ -467,6 +467,6 @@ struct device_private {
 	struct mbox_chan **mbox;
 };
 
-extern struct device_private iproc_priv;
+extern struct bcm_device_private iproc_priv;
 
 #endif
diff --git a/drivers/crypto/bcm/util.c b/drivers/crypto/bcm/util.c
index 2b304fc78059..77aeedb84055 100644
--- a/drivers/crypto/bcm/util.c
+++ b/drivers/crypto/bcm/util.c
@@ -348,7 +348,7 @@ char *spu_alg_name(enum spu_cipher_alg alg, enum spu_cipher_mode mode)
 static ssize_t spu_debugfs_read(struct file *filp, char __user *ubuf,
 				size_t count, loff_t *offp)
 {
-	struct device_private *ipriv;
+	struct bcm_device_private *ipriv;
 	char *buf;
 	ssize_t ret, out_offset, out_count;
 	int i;


  reply	other threads:[~2020-12-30 13:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-29 15:13 BTFIDS: FAILED unresolved symbol udp6_sock Qais Yousef
2020-12-29 17:34 ` Jiri Olsa
2020-12-29 23:28   ` Qais Yousef
2020-12-30  9:03     ` Jiri Olsa
2020-12-30 13:27       ` Jiri Olsa [this message]
2020-12-30 13:28         ` Jiri Olsa
2020-12-30 14:19           ` Arnaldo Carvalho de Melo
2020-12-30 15:04             ` Jiri Olsa
2020-12-30 15:29           ` Qais Yousef
2021-01-02 22:25         ` Andrii Nakryiko
2021-01-02 23:06           ` Jiri Olsa
2021-01-04 20:54             ` Andrii Nakryiko

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=20201230132759.GB577428@krava \
    --to=jolsa@redhat.com \
    --cc=acme@kernel.org \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=qais.yousef@arm.com \
    /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.