public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
* [kernel] 5.10.148 / 5.19.16 - pahole 1.24: BTFIDS vmlinux,FAILED: load BTF from vmlinux: Invalid argument
@ 2022-10-15 16:48 Philip Müller
  2022-10-15 18:25 ` Philip Müller
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Philip Müller @ 2022-10-15 16:48 UTC (permalink / raw)
  To: bpf, Arnaldo Carvalho de Melo, Daniel Borkmann,
	Martin Rodriguez Reboredo, Andrii Nakryiko, Jiri Olsa
  Cc: Bernhard Landauer

Hi all,

I just got the following error for 5.10.148 and 5.19.16 when compiling 
with pahole 1.24 on CONFIG_DEBUG_INFO_BTF=y:

   BTFIDS  vmlinux
FAILED: load BTF from vmlinux: Invalid argument
make: *** [Makefile:1168: vmlinux] Error 255
make: *** Deleting file 'vmlinux'

similar to: 
https://lore.kernel.org/bpf/20220825171620.cioobudss6ovyrkc@altlinux.org/t/

For 5.19 I applied the following patch:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git/plain/releases/5.15.66/kbuild-add-skip_encoding_btf_enum64-option-to-pahole.patch

I wonder what is needed to get 5.10 kernel series compiled and if 5.19 
really doesn't support enum64.

-- 
Best, Philip

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [kernel] 5.10.148 / 5.19.16 - pahole 1.24: BTFIDS vmlinux,FAILED: load BTF from vmlinux: Invalid argument
  2022-10-15 16:48 [kernel] 5.10.148 / 5.19.16 - pahole 1.24: BTFIDS vmlinux,FAILED: load BTF from vmlinux: Invalid argument Philip Müller
@ 2022-10-15 18:25 ` Philip Müller
  2022-10-15 18:33 ` Martin Rodriguez Reboredo
  2022-10-17 21:29 ` Jiri Olsa
  2 siblings, 0 replies; 4+ messages in thread
From: Philip Müller @ 2022-10-15 18:25 UTC (permalink / raw)
  To: bpf, Arnaldo Carvalho de Melo, Daniel Borkmann,
	Martin Rodriguez Reboredo, Andrii Nakryiko, Jiri Olsa
  Cc: Bernhard Landauer

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

I came now up with this ...

-- 
Best, Philip

[-- Attachment #2: bpf-add-skip_encoding_btf_enum64-option-to-pahole.patch --]
[-- Type: text/x-patch, Size: 1717 bytes --]

From: Philip Müller <philm@manjaro.org>
Date: Sat, 15 Oct 2021 20:09:13 +0200
Subject: [PATCH] bpf: Add skip_encoding_btf_enum64 option to pahole

New pahole (version 1.24) generates by default new BTF_KIND_ENUM64 BTF tag,
which is not supported by stable kernel.

As a result the kernel with CONFIG_DEBUG_INFO_BTF option will fail to
compile with following error:

  BTFIDS  vmlinux
FAILED: load BTF from vmlinux: Invalid argument

New pahole provides --skip_encoding_btf_enum64 option to skip BTF_KIND_ENUM64
generation and produce BTF supported by stable kernel.

Adding this option to scripts/link-vmlinux.sh.

This change does not have equivalent commit in linus tree, because linus tree
has support for BTF_KIND_ENUM64 tag, so it does not need to be disabled.

Signed-off-by: Philip Müller <philm@manjaro.org>
---
 scripts/link-vmlinux.sh | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh
index 3b261b0f74f0a7..667aacb9261cf2 100755
--- a/scripts/link-vmlinux.sh
+++ b/scripts/link-vmlinux.sh
@@ -213,6 +213,7 @@ vmlinux_link()
 gen_btf()
 {
 	local pahole_ver
+	local extra_paholeopt=
 
 	if ! [ -x "$(command -v ${PAHOLE})" ]; then
 		echo >&2 "BTF: ${1}: pahole (${PAHOLE}) is not available"
@@ -227,8 +228,12 @@ gen_btf()
 
 	vmlinux_link ${1}
 
+	if [ "${pahole_ver}" -ge "124" ]; then
+		extra_paholeopt="${extra_paholeopt} --skip_encoding_btf_enum64"
+	fi
+
 	info "BTF" ${2}
-	LLVM_OBJCOPY=${OBJCOPY} ${PAHOLE} -J ${1}
+	LLVM_OBJCOPY=${OBJCOPY} ${PAHOLE} -J ${extra_paholeopt} ${1}
 
 	# Create ${2} which contains just .BTF section but no symbols. Add
 	# SHF_ALLOC because .BTF will be part of the vmlinux image. --strip-all

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [kernel] 5.10.148 / 5.19.16 - pahole 1.24: BTFIDS vmlinux,FAILED: load BTF from vmlinux: Invalid argument
  2022-10-15 16:48 [kernel] 5.10.148 / 5.19.16 - pahole 1.24: BTFIDS vmlinux,FAILED: load BTF from vmlinux: Invalid argument Philip Müller
  2022-10-15 18:25 ` Philip Müller
@ 2022-10-15 18:33 ` Martin Rodriguez Reboredo
  2022-10-17 21:29 ` Jiri Olsa
  2 siblings, 0 replies; 4+ messages in thread
From: Martin Rodriguez Reboredo @ 2022-10-15 18:33 UTC (permalink / raw)
  To: Philip Müller, bpf
  Cc: Arnaldo Carvalho de Melo, Daniel Borkmann, Andrii Nakryiko,
	Jiri Olsa, Bernhard Landauer

On 10/15/22 13:48, Philip Müller wrote:
> Hi all,
> 
> I just got the following error for 5.10.148 and 5.19.16 when compiling
> with pahole 1.24 on CONFIG_DEBUG_INFO_BTF=y:
> 
>   BTFIDS  vmlinux
> FAILED: load BTF from vmlinux: Invalid argument
> make: *** [Makefile:1168: vmlinux] Error 255
> make: *** Deleting file 'vmlinux'
> 
> similar to:
> https://lore.kernel.org/bpf/20220825171620.cioobudss6ovyrkc@altlinux.org/t/
> 
> For 5.19 I applied the following patch:
> https://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git/plain/releases/5.15.66/kbuild-add-skip_encoding_btf_enum64-option-to-pahole.patch
> 
> I wonder what is needed to get 5.10 kernel series compiled and if 5.19
> really doesn't support enum64.
> 

This was buried for a month or so but I think it might fix the issue for
5.19

https://lore.kernel.org/bpf/20220916171234.841556-1-yakoyoku@gmail.com/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [kernel] 5.10.148 / 5.19.16 - pahole 1.24: BTFIDS vmlinux,FAILED: load BTF from vmlinux: Invalid argument
  2022-10-15 16:48 [kernel] 5.10.148 / 5.19.16 - pahole 1.24: BTFIDS vmlinux,FAILED: load BTF from vmlinux: Invalid argument Philip Müller
  2022-10-15 18:25 ` Philip Müller
  2022-10-15 18:33 ` Martin Rodriguez Reboredo
@ 2022-10-17 21:29 ` Jiri Olsa
  2 siblings, 0 replies; 4+ messages in thread
From: Jiri Olsa @ 2022-10-17 21:29 UTC (permalink / raw)
  To: Philip Müller
  Cc: bpf, Arnaldo Carvalho de Melo, Daniel Borkmann,
	Martin Rodriguez Reboredo, Andrii Nakryiko, Bernhard Landauer

On Sat, Oct 15, 2022 at 06:48:03PM +0200, Philip Müller wrote:
> Hi all,
> 
> I just got the following error for 5.10.148 and 5.19.16 when compiling with
> pahole 1.24 on CONFIG_DEBUG_INFO_BTF=y:
> 
>   BTFIDS  vmlinux
> FAILED: load BTF from vmlinux: Invalid argument
> make: *** [Makefile:1168: vmlinux] Error 255
> make: *** Deleting file 'vmlinux'
> 
> similar to:
> https://lore.kernel.org/bpf/20220825171620.cioobudss6ovyrkc@altlinux.org/t/
> 
> For 5.19 I applied the following patch:
> https://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git/plain/releases/5.15.66/kbuild-add-skip_encoding_btf_enum64-option-to-pahole.patch
> 
> I wonder what is needed to get 5.10 kernel series compiled and if 5.19
> really doesn't support enum64.

hi,
thanks for the report, I think this is same issue as discussed in here:
  https://lore.kernel.org/bpf/Y02Yv%2FubuCtVhtZk@dev-arch.thelio-3990X/

I'll send 5.10 backport and there's already fix for 5.19 on the list:
  https://lore.kernel.org/bpf/20220916171234.841556-1-yakoyoku@gmail.com/

thanks
jirka

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-10-17 21:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-15 16:48 [kernel] 5.10.148 / 5.19.16 - pahole 1.24: BTFIDS vmlinux,FAILED: load BTF from vmlinux: Invalid argument Philip Müller
2022-10-15 18:25 ` Philip Müller
2022-10-15 18:33 ` Martin Rodriguez Reboredo
2022-10-17 21:29 ` Jiri Olsa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox