From: Ihor Solodrai <ihor.solodrai@linux.dev>
To: bot+bpf-ci@kernel.org, ast@kernel.org, andrii@kernel.org,
daniel@iogearbox.net, eddyz87@gmail.com, memxor@gmail.com
Cc: alan.maguire@oracle.com, jolsa@kernel.org, emil@etsalapatis.com,
bpf@vger.kernel.org, martin.lau@kernel.org,
yonghong.song@linux.dev, clm@meta.com
Subject: Re: [PATCH bpf-next v2 6/6] docs, resolve_btfids: Document kfunc BTF annotation emission
Date: Thu, 6 Aug 2026 14:13:59 -0700 [thread overview]
Message-ID: <33b6923a-51ed-4e6f-b41a-8780992fa262@linux.dev> (raw)
In-Reply-To: <a55ccb52e205bc8a32d3ae6c179de333746ef912a9a259f18425b33935509653@mail.kernel.org>
On 8/5/26 5:01 PM, bot+bpf-ci@kernel.org wrote:
>> diff --git a/Documentation/bpf/kfuncs.rst b/Documentation/bpf/kfuncs.rst
>> index cbde86d082cce..c60fc574e8b06 100644
>> --- a/Documentation/bpf/kfuncs.rst
>> +++ b/Documentation/bpf/kfuncs.rst
>> @@ -472,6 +472,14 @@ type. An example is shown below::
>> }
>> late_initcall(init_subsystem);
>>
>> +At kernel build time the ``resolve_btfids`` tool discovers all kfuncs from the
>> +registered ``BTF_SET8_KFUNCS`` sets and emits their BTF annotations into the
>> +kernel's BTF; these annotations were historically produced by pahole. For each
>> +discovered kfunc ``resolve_btfids`` emits a ``bpf_kfunc`` BTF decl tag, a
>> +``bpf_fastcall`` decl tag when the kfunc is flagged ``KF_FASTCALL``, and the
>> +``address_space(1)`` type attribute on the return value and/or arguments flagged
>> +``KF_ARENA_RET``, ``KF_ARENA_ARG1`` or ``KF_ARENA_ARG2`` (see section 2.8).
>
> Emil Tsalapatis suggested in v1 replacing "address_space(1)" with "arena"
> throughout the documentation for better readability. This nit was not
> addressed in v2.
>
> The term "address_space(1)" appears in four locations across this commit
> (kfuncs.rst, changes.rst, Makefile.btf, and main.c). Would using "arena"
> be clearer, especially since the code already defines TYPE_ATTR_ARENA?
Nonsense feedback from the bot. Ignoring.
>
>> +
>> 2.7 Specifying no-cast aliases with ___init
>> --------------------------------------------
>>
>> diff --git a/Documentation/process/changes.rst b/Documentation/process/changes.rst
>> index 1ca8c5f73ad00..6d1dbe4abf0f0 100644
>> --- a/Documentation/process/changes.rst
>> +++ b/Documentation/process/changes.rst
>> @@ -147,10 +147,9 @@ Since Linux 5.2, if CONFIG_DEBUG_INFO_BTF is selected, the build system
>> generates BTF (BPF Type Format) from DWARF in vmlinux, a bit later from kernel
>> modules as well. This requires pahole v1.22 or later.
>>
>> -Since Linux 7.0, kfuncs annotated with KF_IMPLICIT_ARGS require pahole v1.26
>> -or later. Without it, such kfuncs will have incorrect BTF prototypes in
>> -vmlinux, causing BPF programs to fail to load with a "func_proto incompatible
>> -with vmlinux" error. Many sched_ext kfuncs are affected.
>> +Kfunc BTF annotations (the bpf_kfunc and bpf_fastcall decl tags and the arena
>> +address_space(1) type attribute) are emitted in-tree by resolve_btfids from the
>> +BTF_KFUNCS sets, so they no longer depend on a specific pahole version.
>>
>> It is found in the 'dwarves' or 'pahole' distro packages or from
>> https://fedorapeople.org/~acme/dwarves/.
>> diff --git a/scripts/Makefile.btf b/scripts/Makefile.btf
>> index a1812985a61aa..717e76ce96a71 100644
>> --- a/scripts/Makefile.btf
>> +++ b/scripts/Makefile.btf
>> @@ -14,6 +14,9 @@ pahole-flags-$(call test-ge, $(pahole-ver), 125) += --skip_encoding_btf_inconsis
>> else
>>
>> # Switch to using --btf_features for v1.26 and later.
>> +#
>> +# kfunc BTF annotations (bpf_kfunc/bpf_fastcall decl tags and the arena
>> +# address_space(1) type attribute) are emitted by resolve_btfids, not pahole.
>> pahole-flags-$(call test-ge, $(pahole-ver), 126) = -j$(JOBS) --btf_features=encode_force,var,float,enum64,decl_tag,type_tag,optimized_func,consistent_func
>>
>> pahole-flags-$(call test-ge, $(pahole-ver), 131) += --btf_features=layout
>> diff --git a/tools/bpf/resolve_btfids/main.c b/tools/bpf/resolve_btfids/main.c
>> index ea25ca34aa006..66f4014e6aa17 100644
>> --- a/tools/bpf/resolve_btfids/main.c
>> +++ b/tools/bpf/resolve_btfids/main.c
>> @@ -58,6 +58,17 @@
>> * __BTF_ID__func__vfs_fallocate__5:
>> * .zero 4
>> * .word (1 << 3) | (1 << 1) | (1 << 2)
>> + *
>> + * In addition to resolving BTF IDs, resolve_btfids performs kernel-specific
>> + * BTF-to-BTF transformations for kfuncs found in BTF_SET8_KFUNCS sets. For
>> + * each such kfunc it:
>> + *
>> + * - emits a "bpf_kfunc" decl tag, and "bpf_fastcall" when KF_FASTCALL is set;
>> + * - wraps the return value and/or arguments flagged KF_ARENA_RET,
>> + * KF_ARENA_ARG1 or KF_ARENA_ARG2 with the "address_space(1)" type attribute;
>> + * - rewrites the prototype of KF_IMPLICIT_ARGS kfuncs.
>> + *
>> + * These kfunc annotations were historically produced by pahole.
>> */
>>
>> #define _GNU_SOURCE
>
>
> ---
> AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
> See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md
>
> CI run summary: https://github.com/kernel-patches/bpf/actions/runs/31056256483
next prev parent reply other threads:[~2026-08-06 21:14 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-05 23:06 [PATCH bpf-next v2 0/6] resolve_btfids: Implement BTF tags emission for kfuncs Ihor Solodrai
2026-08-05 23:06 ` [PATCH bpf-next v2 1/6] resolve_btfids: Deduplicate BTF after btf2btf transformations Ihor Solodrai
2026-08-06 19:05 ` Eduard Zingerman
2026-08-06 20:48 ` Ihor Solodrai
2026-08-06 20:52 ` Eduard Zingerman
2026-08-05 23:06 ` [PATCH bpf-next v2 2/6] resolve_btfids: Process KF_ARENA_* flags in resolve_btfids Ihor Solodrai
2026-08-06 19:12 ` Eduard Zingerman
2026-08-06 21:02 ` Ihor Solodrai
2026-08-06 21:12 ` Eduard Zingerman
2026-08-06 21:16 ` Ihor Solodrai
2026-08-05 23:06 ` [PATCH bpf-next v2 3/6] selftests/bpf: Verify arena type tags in resolve_btfids test Ihor Solodrai
2026-08-05 23:17 ` sashiko-bot
2026-08-06 21:09 ` Ihor Solodrai
2026-08-06 19:15 ` Eduard Zingerman
2026-08-05 23:06 ` [PATCH bpf-next v2 4/6] resolve_btfids: Emit bpf_kfunc and bpf_fastcall decl tags Ihor Solodrai
2026-08-06 19:18 ` Eduard Zingerman
2026-08-05 23:06 ` [PATCH bpf-next v2 5/6] selftests/bpf: Verify decl tags emission in resolve_btfids test Ihor Solodrai
2026-08-06 19:20 ` Eduard Zingerman
2026-08-05 23:06 ` [PATCH bpf-next v2 6/6] docs, resolve_btfids: Document kfunc BTF annotation emission Ihor Solodrai
2026-08-05 23:16 ` sashiko-bot
2026-08-06 21:12 ` Ihor Solodrai
2026-08-06 0:01 ` bot+bpf-ci
2026-08-06 21:13 ` Ihor Solodrai [this message]
2026-08-06 19:47 ` Eduard Zingerman
2026-08-06 21:06 ` Ihor Solodrai
2026-08-06 21:17 ` Eduard Zingerman
2026-08-06 21:19 ` Ihor Solodrai
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=33b6923a-51ed-4e6f-b41a-8780992fa262@linux.dev \
--to=ihor.solodrai@linux.dev \
--cc=alan.maguire@oracle.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bot+bpf-ci@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=clm@meta.com \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=emil@etsalapatis.com \
--cc=jolsa@kernel.org \
--cc=martin.lau@kernel.org \
--cc=memxor@gmail.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 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.