From: Yonghong Song <yonghong.song@linux.dev>
To: bot+bpf-ci@kernel.org, bpf@vger.kernel.org
Cc: ast@kernel.org, andrii@kernel.org, daniel@iogearbox.net,
eddyz87@gmail.com, kernel-team@fb.com, martin.lau@kernel.org,
clm@meta.com, ihor.solodrai@linux.dev
Subject: Re: [PATCH bpf-next v3 09/11] selftests/bpf: Test global functions returning arena pointers by value
Date: Fri, 28 Aug 2026 11:26:16 -0700 [thread overview]
Message-ID: <eef81f76-b208-4549-8b01-5e9cfa8bea86@linux.dev> (raw)
In-Reply-To: <0c9dfc8370742b9ab97d7d248fb9698574ff6ca3074f761c400232d20ec7695f@mail.kernel.org>
On 8/27/26 12:04 AM, bot+bpf-ci@kernel.org wrote:
>> Cover the by-value struct returns a global function may now make: two
>> arena pointers filling R0:R2, an arena pointer beside a scalar, an array
>> of them, and an eight byte struct returned in R0 alone. The existing
>> cases for a struct and a union carrying a plain pointer stay rejected.
> This isn't a bug, but would it be worth adding the new union-of-arena-
> pointer case to the enumeration? The patch adds union arena_upair /
> global_ret_arena_union() / aggregate_ret_global_arena_union() as a
> sixteen-byte union of an arena pointer and a __u64[2]. Since the next
> sentence says "cases for a struct and a union carrying a plain pointer
> stay rejected", a reader might think the only union touched is a rejected
> one, when the patch actually adds a newly-accepted union case as well.
There is no need to have too many union cases. The existing one
should be enough.
>
>> diff --git a/tools/testing/selftests/bpf/progs/verifier_arena.c b/tools/testing/selftests/bpf/progs/verifier_arena.c
>> index 815f342eb4b05..672a3aadd9cb2 100644
>> --- a/tools/testing/selftests/bpf/progs/verifier_arena.c
>> +++ b/tools/testing/selftests/bpf/progs/verifier_arena.c
>> @@ -734,4 +734,52 @@ int check_arena_arg_ret(void *ctx)
>> return 0;
>> }
>>
>> +#if defined(__clang_major__) && __clang_major__ >= 23
>> +
>> +struct arena_page_pair {
>> + u32 __arena *first;
>> + u32 __arena *second;
>> +};
>> +
>> +__weak struct arena_page_pair split_arena_page(u32 __arena *page)
>> +{
>> + struct arena_page_pair pair;
>> +
>> + pair.first = page;
>> + pair.second = page + 1;
>> +
>> + return pair;
>> +}
> This isn't a bug, but since the returned pointers are the first two u32
> slots of a single page rather than two halves of it (page and page + 1
> are offsets 0 and 4 within a single 4096-byte allocation), would a name
> like arena_word_pair() / struct arena_word_pair describe the helper more
> directly? The neighbouring arena return tests in the same file name
> themselves after what they exercise rather than after an imagined data
> layout (check_arena_arg_ret, check_arena_arg_quals1/2).
Okay, I will use arena_work_pair() then.
>
>
> ---
> 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/33045482525
next prev parent reply other threads:[~2026-08-28 18:26 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-27 6:11 [PATCH bpf-next v3 00/11] bpf: Allow arena pointers in by-value returns Yonghong Song
2026-08-27 6:11 ` [PATCH bpf-next v3 01/11] bpf: Record each half of a paired return value in verifier diagnostics Yonghong Song
2026-08-27 6:11 ` [PATCH bpf-next v3 02/11] bpf: Drop the recursion depth argument of btf_type_is_scalar_struct() Yonghong Song
2026-08-27 7:04 ` bot+bpf-ci
2026-08-28 17:39 ` Yonghong Song
2026-08-27 6:11 ` [PATCH bpf-next v3 03/11] bpf: Add btf_type_is_arena_ptr() Yonghong Song
2026-08-27 6:11 ` [PATCH bpf-next v3 04/11] bpf: Let the by-value struct walk take the kinds of member it accepts Yonghong Song
2026-08-27 6:11 ` [PATCH bpf-next v3 05/11] bpf: Report which member makes a kfunc return type unsupported Yonghong Song
2026-08-27 7:04 ` bot+bpf-ci
2026-08-28 17:45 ` Yonghong Song
2026-08-27 6:11 ` [PATCH bpf-next v3 06/11] bpf: Allow a global function to return arena pointers by value Yonghong Song
2026-08-27 6:33 ` sashiko-bot
2026-08-28 18:00 ` Yonghong Song
2026-08-27 6:11 ` [PATCH bpf-next v3 07/11] bpf: Allow arena pointers in a by-value kfunc return Yonghong Song
2026-08-27 6:55 ` sashiko-bot
2026-08-28 18:10 ` Yonghong Song
2026-08-27 6:11 ` [PATCH bpf-next v3 08/11] selftests/bpf: Check the member named for an unsupported kfunc return type Yonghong Song
2026-08-27 7:04 ` bot+bpf-ci
2026-08-28 18:20 ` Yonghong Song
2026-08-27 6:12 ` [PATCH bpf-next v3 09/11] selftests/bpf: Test global functions returning arena pointers by value Yonghong Song
2026-08-27 7:04 ` bot+bpf-ci
2026-08-28 18:26 ` Yonghong Song [this message]
2026-08-27 6:12 ` [PATCH bpf-next v3 10/11] selftests/bpf: Test kfuncs " Yonghong Song
2026-08-27 7:17 ` bot+bpf-ci
2026-08-28 18:28 ` Yonghong Song
2026-08-27 6:12 ` [PATCH bpf-next v3 11/11] docs/bpf: Document arena pointers in a by-value return Yonghong Song
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=eef81f76-b208-4549-8b01-5e9cfa8bea86@linux.dev \
--to=yonghong.song@linux.dev \
--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=ihor.solodrai@linux.dev \
--cc=kernel-team@fb.com \
--cc=martin.lau@kernel.org \
/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.