public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@kernel.org>
To: stable@vger.kernel.org
Cc: "Mel Gorman" <mgorman@techsingularity.net>,
	"Arnaldo Carvalho de Melo" <acme@redhat.com>,
	"Hao Luo" <haoluo@google.com>,
	"Michal Suchanek" <msuchanek@suse.de>,
	bpf@vger.kernel.org, "Arnaldo Carvalho de Melo" <acme@kernel.org>,
	"Daniel Borkmann" <daniel@iogearbox.net>,
	"Martin Rodriguez Reboredo" <yakoyoku@gmail.com>,
	"Andrii Nakryiko" <andrii@kernel.org>,
	"Javier Martinez Canillas" <javierm@redhat.com>,
	"Ilya Leoshkevich" <iii@linux.ibm.com>,
	"Nathan Chancellor" <nathan@kernel.org>,
	"Philip Müller" <philm@manjaro.org>
Subject: [PATCH stable 5.10 3/5] kbuild: skip per-CPU BTF generation for pahole v1.18-v1.21
Date: Wed, 19 Oct 2022 10:56:02 +0200	[thread overview]
Message-ID: <20221019085604.1017583-4-jolsa@kernel.org> (raw)
In-Reply-To: <20221019085604.1017583-1-jolsa@kernel.org>

From: Andrii Nakryiko <andrii@kernel.org>

commit a0b8200d06ad6450c179407baa5f0f52f8cfcc97 upstream.

[small context changes due to missing floats support in 5.10]

Commit "mm/page_alloc: convert per-cpu list protection to local_lock" will
introduce a zero-sized per-CPU variable, which causes pahole to generate
invalid BTF.  Only pahole versions 1.18 through 1.21 are impacted, as
before 1.18 pahole doesn't know anything about per-CPU variables, and 1.22
contains the proper fix for the issue.

Luckily, pahole 1.18 got --skip_encoding_btf_vars option disabling BTF
generation for per-CPU variables in anticipation of some unanticipated
problems.  So use this escape hatch to disable per-CPU var BTF info on
those problematic pahole versions.  Users relying on availability of
per-CPU var BTFs would need to upgrade to pahole 1.22+, but everyone won't
notice any regressions.

Link: https://lkml.kernel.org/r/20210530002536.3193829-1-andrii@kernel.org
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Mel Gorman <mgorman@techsingularity.net>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Hao Luo <haoluo@google.com>
Cc: Michal Suchanek <msuchanek@suse.de>
Cc: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 scripts/link-vmlinux.sh | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh
index 72bf14df6903..bbb22be4c8f1 100755
--- a/scripts/link-vmlinux.sh
+++ b/scripts/link-vmlinux.sh
@@ -161,6 +161,11 @@ gen_btf()
 
 	vmlinux_link ${1}
 
+	if [ "${pahole_ver}" -ge "118" ] && [ "${pahole_ver}" -le "121" ]; then
+		# pahole 1.18 through 1.21 can't handle zero-sized per-CPU vars
+		extra_paholeopt="${extra_paholeopt} --skip_encoding_btf_vars"
+	fi
+
 	info "BTF" ${2}
 	LLVM_OBJCOPY="${OBJCOPY}" ${PAHOLE} -J ${extra_paholeopt} ${1}
 
-- 
2.37.3


  parent reply	other threads:[~2022-10-19  9:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-19  8:55 [PATCH stable 5.10 0/5] kbuild: Fix compilation for latest pahole release Jiri Olsa
2022-10-19  8:56 ` [PATCH stable 5.10 1/5] bpf: Generate BTF_KIND_FLOAT when linking vmlinux Jiri Olsa
2022-10-19  8:56 ` [PATCH stable 5.10 2/5] kbuild: Quote OBJCOPY var to avoid a pahole call break the build Jiri Olsa
2022-10-19 10:28   ` Greg KH
2022-10-19 11:18     ` Jiri Olsa
2022-10-19  8:56 ` Jiri Olsa [this message]
2022-10-19  8:56 ` [PATCH stable 5.10 4/5] kbuild: Unify options for BTF generation for vmlinux and modules Jiri Olsa
2022-10-19  8:56 ` [PATCH stable 5.10 5/5] kbuild: Add skip_encoding_btf_enum64 option to pahole Jiri Olsa
2022-10-19 14:55 ` [PATCH stable 5.10 0/5] kbuild: Fix compilation for latest pahole release Greg KH
2022-10-19 15:30   ` Jiri Olsa
2022-10-26 16:44 ` Greg KH

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=20221019085604.1017583-4-jolsa@kernel.org \
    --to=jolsa@kernel.org \
    --cc=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=andrii@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=haoluo@google.com \
    --cc=iii@linux.ibm.com \
    --cc=javierm@redhat.com \
    --cc=mgorman@techsingularity.net \
    --cc=msuchanek@suse.de \
    --cc=nathan@kernel.org \
    --cc=philm@manjaro.org \
    --cc=stable@vger.kernel.org \
    --cc=yakoyoku@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox