From: "Kumar Kartikeya Dwivedi" <memxor@gmail.com>
To: <bot+bpf-ci@kernel.org>, <bpf@vger.kernel.org>
Cc: <ast@kernel.org>, <andrii@kernel.org>, <daniel@iogearbox.net>,
<eddyz87@gmail.com>, <emil@etsalapatis.com>, <tj@kernel.org>,
<ihor.solodrai@linux.dev>, <kkd@meta.com>, <kernel-team@meta.com>,
<martin.lau@kernel.org>, <yonghong.song@linux.dev>,
<clm@meta.com>
Subject: Re: [PATCH bpf-next v1 2/2] selftests/bpf: Test resolve_btfids arena argument suffixes
Date: Sun, 09 Aug 2026 16:07:41 +0200 [thread overview]
Message-ID: <DKKGZT7LJJW1.S0PQ3KJ9R3LC@gmail.com> (raw)
In-Reply-To: <e425dd364d874c0071dd4096c38ba72df96da2afd8c541d99f3a48c878808e5d@mail.kernel.org>
On Sun Aug 9, 2026 at 11:57 AM CEST, bot+bpf-ci wrote:
>> diff --git a/tools/testing/selftests/bpf/prog_tests/resolve_btfids.c b/tools/testing/selftests/bpf/prog_tests/resolve_btfids.c
>> index 732cfed35e1c..9bd84fe32b89 100644
>> --- a/tools/testing/selftests/bpf/prog_tests/resolve_btfids.c
>> +++ b/tools/testing/selftests/bpf/prog_tests/resolve_btfids.c
>> @@ -15,6 +15,7 @@
>> #define DECL_TAG_FASTCALL "bpf_fastcall"
>> #define DECL_TAG_KFUNC "bpf_kfunc"
>> #define TYPE_ATTR_ARENA "address_space(1)"
>> +#define ARENA_ARG(n) (1U << (n))
>
> This isn't a bug, but ARENA_ARG(n) is zero-based while the KF_ARENA_ARGn
> flags it sits next to are one-based, so the same argument is spelled two
> different ways inside a single table row.
>
> For example, '{ "kfunc_d", -1, KF_ARENA_ARG2, ARENA_ARG(1), false }'
> means KF_ARENA_ARG2 and ARENA_ARG(1) refer to the same parameter.
>
> Would a name like ARENA_ARG_IDX(n), or a short comment noting that
> ARENA_ARG(0) corresponds to KF_ARENA_ARG1, help keep the two columns
> from drifting?
>
I think it's ok, we might drop the other flag soon anyhow.
> [ ... ]
>
>> @@ -49,13 +50,18 @@ struct kfunc_symbol {
>> const char *name;
>> s32 id;
>> u32 flags;
>> + u32 arena_args;
>> + bool arena_ret;
>> };
>>
>> static struct kfunc_symbol kfunc_symbols[] = {
>> - { "kfunc_a", -1, 0 },
>> - { "kfunc_b", -1, KF_FASTCALL },
>> - { "kfunc_c", -1, KF_ARENA_RET | KF_ARENA_ARG1 | KF_ARENA_ARG2 },
>> - { "kfunc_d", -1, KF_ARENA_ARG2 },
>> + { "kfunc_a", -1, 0, 0, false },
>> + { "kfunc_b", -1, KF_FASTCALL, 0, false },
>> + { "kfunc_c", -1, KF_ARENA_RET | KF_ARENA_ARG1 | KF_ARENA_ARG2,
>> + ARENA_ARG(0) | ARENA_ARG(1), true },
>> + { "kfunc_d", -1, KF_ARENA_ARG2, ARENA_ARG(1), false },
>> + { "kfunc_e", -1, 0, ARENA_ARG(0) | ARENA_ARG(1) | ARENA_ARG(2) |
>> + ARENA_ARG(3) | ARENA_ARG(4), false },
>> };
>
> This isn't a bug, but the new arena_ret field duplicates information
> that the existing flags field already carries.
>
> resolve_btfids only ever arena-tags a return value from KF_ARENA_RET:
>
> tools/bpf/resolve_btfids/main.c:add_arena_tagged_proto() {
> ...
> if (kfunc->flags & KF_ARENA_RET)
> /* tag return */
> ...
> }
>
> There is no return-position suffix mechanism, so arena_ret is exactly
> !!(flags & KF_ARENA_RET) for every row and the old expression it
> replaced was already correct.
>
> Since only KF_ARENA_RET drives return tagging, could the return
> assertion keep using !!(flags & KF_ARENA_RET) instead of the new
> arena_ret field?
>
I found this more clear, but am fine with reworking in any direction.
> [ ... ]
>
>
> ---
> 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/31305217088
prev parent reply other threads:[~2026-08-09 14:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-09 8:51 [PATCH bpf-next v1 0/2] Add resolve_btfids support for __arena kfunc suffix Kumar Kartikeya Dwivedi
2026-08-09 8:51 ` [PATCH bpf-next v1 1/2] resolve_btfids: Emit arena attributes from kfunc parameter suffixes Kumar Kartikeya Dwivedi
2026-08-09 10:10 ` bot+bpf-ci
2026-08-09 14:08 ` Kumar Kartikeya Dwivedi
2026-08-09 8:51 ` [PATCH bpf-next v1 2/2] selftests/bpf: Test resolve_btfids arena argument suffixes Kumar Kartikeya Dwivedi
2026-08-09 9:57 ` bot+bpf-ci
2026-08-09 14:07 ` Kumar Kartikeya Dwivedi [this message]
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=DKKGZT7LJJW1.S0PQ3KJ9R3LC@gmail.com \
--to=memxor@gmail.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=ihor.solodrai@linux.dev \
--cc=kernel-team@meta.com \
--cc=kkd@meta.com \
--cc=martin.lau@kernel.org \
--cc=tj@kernel.org \
--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.