BPF List
 help / color / mirror / Atom feed
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,
	mason@kernel.org, ihor.solodrai@linux.dev
Subject: Re: [PATCH bpf-next 11/12] selftests/bpf: Add inline-asm tests for by-value arguments
Date: Mon, 7 Sep 2026 21:35:21 -0700	[thread overview]
Message-ID: <ad07b17e-4933-4324-ad35-e95b0dacbb55@linux.dev> (raw)
In-Reply-To: <f3466f8c3246d1abb06f2651a539c2697670246105f2b4664cba6455fe9199c0@mail.kernel.org>



On 9/3/26 11:09 PM, bot+bpf-ci@kernel.org wrote:
>> diff --git a/tools/testing/selftests/bpf/prog_tests/aggregate_arg.c b/tools/testing/selftests/bpf/prog_tests/aggregate_arg.c
>> new file mode 100644
>> index 000000000000..b230f3bd3b2a
>> --- /dev/null
>> +++ b/tools/testing/selftests/bpf/prog_tests/aggregate_arg.c
>> @@ -0,0 +1,9 @@
>> +// SPDX-License-Identifier: GPL-2.0
>> +/* Copyright (c) 2026 Meta Platforms, Inc. and affiliates. */
>> +#include <test_progs.h>
>> +#include "aggregate_arg_func.skel.h"
>> +
>> +void test_aggregate_arg(void)
>> +{
>> +	RUN_TESTS(aggregate_arg_func);
>> +}
>> diff --git a/tools/testing/selftests/bpf/progs/aggregate_arg_func.c b/tools/testing/selftests/bpf/progs/aggregate_arg_func.c
>> new file mode 100644
>> index 000000000000..61dd5f86c3a4
>> --- /dev/null
>> +++ b/tools/testing/selftests/bpf/progs/aggregate_arg_func.c
>> @@ -0,0 +1,155 @@
>> +// SPDX-License-Identifier: GPL-2.0
>> +/* Copyright (c) 2026 Meta Platforms, Inc. and affiliates. */
>> +#include <vmlinux.h>
>> +#include <bpf/bpf_helpers.h>
>> +#include "bpf_misc.h"
>> +
>> +typedef unsigned __int128 u128;
>> +
>> +struct pair {
>> +	__u64 lo;
>> +	__u64 hi;
>> +};
> [ ... ]
>
>> +#if defined(__BPF_FEATURE_STACK_ARGUMENT)
>> +
>> +__noinline __u64 global_arg_split(int a, int b, int c, int d, struct pair p)
>> +{
>> +	return (__u64)a + b + c + d + p.lo + p.hi;
>> +}
>> +
>> +SEC("tc")
>> +__failure __msg("global function global_arg_split() needs 6 > 5 argument slots")
>> +__naked int aggregate_arg_split_fail(void)
> [ ... ]
>
>> +SEC("tc")
>> +__failure __msg("global function global_arg_past_regs() needs 7 > 5 argument slots")
>> +__naked int aggregate_arg_past_regs_fail(void)
> [ ... ]
>
>> +SEC("tc")
>> +__failure __msg("global function global_arg_i128_slots() needs 6 > 5 argument slots")
>> +__naked int aggregate_arg_i128_slots_fail(void)
> [ ... ]
>
> A subsystem pattern flags this as potentially concerning: this commit
> creates a new BPF prog file (progs/aggregate_arg_func.c) plus a new
> test_progs entry point (prog_tests/aggregate_arg.c) for by-value
> argument tests, while the immediately preceding commit in the same series
> (7bdde6e0b83d) added by-value aggregate argument tests to the existing
> progs/verifier_int128_arg.c, which is already run by
> prog_tests/verifier.c.
>
> This means coverage for one feature is now split across two test runners
> in the same directory, and struct pair is defined twice
> (progs/verifier_int128_arg.c and progs/aggregate_arg_func.c).
>
> Three of the six new subtests (aggregate_arg_split_fail,
> aggregate_arg_past_regs_fail, aggregate_arg_i128_slots_fail) are pure
> __failure/__msg verifier tests that need no hand-written register layout,
> so they could fit as cases in the existing file. The same is true of
> aggregate_arg_pair_ptr_fail.
>
> Is there a reason to create a separate test file rather than adding these
> tests to the existing progs/verifier_int128_arg.c, which already covers
> by-value aggregate arguments and would consolidate the feature's tests in
> one place?
>
> (For context: the pattern is motivated by the fact that aggregate_arg_pair_asm
> and aggregate_arg_pair_ptr_fail need hand-written register placement that
> C cannot express, and this layout mirrors the existing aggregate_ret
> structure with prog_tests/aggregate_ret.c + progs/aggregate_ret_func.c.
> A following commit extends the test with kfunc cases, so the new entry
> point is reused rather than single-purpose. The question is whether the
> C tests in verifier_int128_arg.c should move here too, so the feature's
> tests live in one place and struct pair is defined once.)

I think it is okay.

>
>
> ---
> 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/33840714551


  reply	other threads:[~2026-09-08  4:35 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-04  5:09 [PATCH bpf-next 00/12] bpf: Support by-value struct and __int128 arguments Yonghong Song
2026-09-04  5:10 ` [PATCH bpf-next 01/12] selftests/bpf: Add a test for an __int128 by-value argument Yonghong Song
2026-09-04  5:10 ` [PATCH bpf-next 02/12] bpf: Index global function arguments by argument slot Yonghong Song
2026-09-04  5:10 ` [PATCH bpf-next 03/12] bpf: Support by-value struct arguments up to 16 bytes Yonghong Song
2026-09-04  5:23   ` sashiko-bot
2026-09-08  4:17     ` Yonghong Song
2026-09-04  6:09   ` bot+bpf-ci
2026-09-08  4:19     ` Yonghong Song
2026-09-04  5:10 ` [PATCH bpf-next 04/12] bpf: Support __int128 as a by-value function argument Yonghong Song
2026-09-04  5:32   ` sashiko-bot
2026-09-08  4:20     ` Yonghong Song
2026-09-04  6:09   ` bot+bpf-ci
2026-09-08  4:21     ` Yonghong Song
2026-09-04  5:10 ` [PATCH bpf-next 05/12] bpf: Support by-value struct and __int128 kfunc arguments Yonghong Song
2026-09-04  6:18   ` sashiko-bot
2026-09-08  4:22     ` Yonghong Song
2026-09-04  6:24   ` bot+bpf-ci
2026-09-08  4:23     ` Yonghong Song
2026-09-04  5:10 ` [PATCH bpf-next 06/12] bpf: Add a JIT helper for the outgoing stack of kfunc calls Yonghong Song
2026-09-04  5:25   ` sashiko-bot
2026-09-08  4:26     ` Yonghong Song
2026-09-04  5:10 ` [PATCH bpf-next 07/12] bpf, x86: Place kfunc arguments per the SysV calling convention Yonghong Song
2026-09-04  5:36   ` sashiko-bot
2026-09-08  4:27     ` Yonghong Song
2026-09-04 23:58   ` Alexei Starovoitov
2026-09-06 20:15     ` Yonghong Song
2026-09-08  4:33       ` Alexei Starovoitov
2026-09-08  5:02         ` Yonghong Song
2026-09-08  5:10           ` Yonghong Song
2026-09-08 15:24           ` Alexei Starovoitov
2026-09-08 18:43             ` Yonghong Song
2026-09-09  1:59               ` Alexei Starovoitov
2026-09-04  5:10 ` [PATCH bpf-next 08/12] bpf: Record a 16-byte argument alignment in the function model Yonghong Song
2026-09-04  6:09   ` bot+bpf-ci
2026-09-08  4:28     ` Yonghong Song
2026-09-04  5:10 ` [PATCH bpf-next 09/12] bpf, arm64: Place kfunc arguments per AAPCS64 Yonghong Song
2026-09-04  6:09   ` bot+bpf-ci
2026-09-04  5:10 ` [PATCH bpf-next 10/12] selftests/bpf: Add C tests for by-value arguments up to 16 bytes Yonghong Song
2026-09-04  5:19   ` sashiko-bot
2026-09-08  4:33     ` Yonghong Song
2026-09-04  6:09   ` bot+bpf-ci
2026-09-08  4:34     ` Yonghong Song
2026-09-04  5:10 ` [PATCH bpf-next 11/12] selftests/bpf: Add inline-asm tests for by-value arguments Yonghong Song
2026-09-04  6:09   ` bot+bpf-ci
2026-09-08  4:35     ` Yonghong Song [this message]
2026-09-04  5:11 ` [PATCH bpf-next 12/12] selftests/bpf: Add tests for by-value kfunc arguments 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=ad07b17e-4933-4324-ad35-e95b0dacbb55@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=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=ihor.solodrai@linux.dev \
    --cc=kernel-team@fb.com \
    --cc=martin.lau@kernel.org \
    --cc=mason@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox