BPF List
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: bpf@vger.kernel.org
Cc: Sasha Levin <sashal@kernel.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	John Fastabend <john.fastabend@gmail.com>,
	Andrii Nakryiko <andrii@kernel.org>,
	Eduard Zingerman <eddyz87@gmail.com>,
	Kumar Kartikeya Dwivedi <memxor@gmail.com>,
	Martin KaFai Lau <martin.lau@linux.dev>,
	Song Liu <song@kernel.org>,
	Yonghong Song <yonghong.song@linux.dev>,
	Jiri Olsa <jolsa@kernel.org>,
	Emil Tsalapatis <emil@etsalapatis.com>,
	Ihor Solodrai <ihor.solodrai@linux.dev>,
	Eric Dumazet <edumazet@kernel.org>,
	Kuniyuki Iwashima <kuniyu@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	Willem de Bruijn <willemb@google.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Simon Horman <horms@kernel.org>,
	Amery Hung <ameryhung@gmail.com>,
	Puranjay Mohan <puranjay@kernel.org>,
	Stanislav Fomichev <sdf@fomichev.me>,
	Mahe Tardy <mahe.tardy@gmail.com>,
	Jiayuan Chen <jiayuan.chen@linux.dev>,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	Petr Pavlu <petr.pavlu@suse.com>,
	Leon Hwang <leon.hwang@linux.dev>
Subject: [PATCH bpf-next 2/3] bpf: Don't reference arena kfuncs when arena isn't built
Date: Mon, 19 Oct 2026 17:10:05 -0400	[thread overview]
Message-ID: <20261019211006.2574350-3-sashal@kernel.org> (raw)
In-Reply-To: <20261019211006.2574350-1-sashal@kernel.org>

kernel/bpf/Makefile builds arena.o only for CONFIG_MMU && CONFIG_64BIT,
but special_kfunc_list references bpf_arena_alloc_pages() and
bpf_arena_free_pages() unconditionally, so on 32-bit and !MMU kernels
resolve_btfids can't resolve them:

  WARN: resolve_btfids: unresolved symbol bpf_arena_free_pages
  WARN: resolve_btfids: unresolved symbol bpf_arena_alloc_pages

Since commit 201a454df948 ("resolve_btfids: Fix the --fatal_warnings
exit status") these warnings fail the build with CONFIG_WERROR=y, which
breaks i386 builds with CONFIG_DEBUG_INFO_BTF=y:

  Failed to generate BTF for vmlinux
  Try to disable CONFIG_DEBUG_INFO_BTF

Only reference them under the condition arena.o is built with, and use
BTF_ID_UNUSED otherwise to keep the list in sync with enum
special_kfunc_type. An unresolved ID is zero, like BTF_ID_UNUSED, so the
contents of the list don't change.

Fixes: b8467290edab ("bpf: arena: make arena kfuncs any context safe")
Assisted-by: LLM
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 kernel/bpf/verifier.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 22f095b9dca2d..12229713a4528 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -13639,8 +13639,13 @@ BTF_ID(func, bpf_task_work_schedule_signal)
 BTF_ID(func, bpf_task_work_schedule_resume)
 BTF_ID(func, bpf_call_rcu)
 BTF_ID(func, bpf_call_rcu_tasks_trace)
+#if defined(CONFIG_MMU) && defined(CONFIG_64BIT)
 BTF_ID(func, bpf_arena_alloc_pages)
 BTF_ID(func, bpf_arena_free_pages)
+#else
+BTF_ID_UNUSED
+BTF_ID_UNUSED
+#endif
 #ifdef CONFIG_BPF_EVENTS
 BTF_ID(func, bpf_session_is_return)
 #else
-- 
2.53.0


  parent reply	other threads:[~2026-10-19 21:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-19 21:10 [PATCH bpf-next 0/3] bpf: Fix builds broken by fatal resolve_btfids warnings Sasha Levin
2026-10-19 21:10 ` [PATCH bpf-next 1/3] bpf: Drop unused entries from special_kfunc_list again Sasha Levin
2026-10-19 21:10 ` Sasha Levin [this message]
2026-10-19 21:10 ` [PATCH bpf-next 3/3] bpf: Fix ksock build with BPF_LSM=y and SECURITY_NETWORK=n Sasha Levin
2026-10-19 23:16   ` Mahe Tardy
2026-10-20  0:20 ` [PATCH bpf-next 0/3] bpf: Fix builds broken by fatal resolve_btfids warnings patchwork-bot+netdevbpf

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=20261019211006.2574350-3-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=ameryhung@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=eddyz87@gmail.com \
    --cc=edumazet@kernel.org \
    --cc=emil@etsalapatis.com \
    --cc=horms@kernel.org \
    --cc=ihor.solodrai@linux.dev \
    --cc=jiayuan.chen@linux.dev \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --cc=leon.hwang@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mahe.tardy@gmail.com \
    --cc=martin.lau@linux.dev \
    --cc=memxor@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=petr.pavlu@suse.com \
    --cc=puranjay@kernel.org \
    --cc=sdf@fomichev.me \
    --cc=song@kernel.org \
    --cc=willemb@google.com \
    --cc=yonghong.song@linux.dev \
    /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