All of lore.kernel.org
 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 v2 11/12] selftests/bpf: Add inline-asm tests for by-value arguments
Date: Thu, 10 Sep 2026 22:37:29 -0700	[thread overview]
Message-ID: <f4454509-b84c-4923-9983-11bc1518a4f8@linux.dev> (raw)
In-Reply-To: <14888dbc8203cddca1f5affa396a0620902c0104604e6eb8dfd9d4a0470b78fc@mail.kernel.org>



On 9/9/26 12:30 AM, 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
> [ ... ]
>
>> 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;
>> +};
>> +
>> +struct too_big {
>> +	__u64 a;
>> +	__u64 b;
>> +	__u64 c;
>> +};
>> +
>> +#if defined(__clang__)
>> +
>> +__noinline __u64 global_arg_pair(int a, struct pair p, int c)
>> +{
>> +	return (__u64)a + p.lo + p.hi + c;
>> +}
> [ ... ]
>
>> +#endif
>> +
>> +__noinline __u64 global_arg_too_big(struct too_big s)
>> +{
>> +	return s.a + s.b + s.c;
>> +}
> [ ... ]
>
>> +#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;
>> +}
> [ ... ]
>
>> +#endif
> This isn't a bug, but would it help a later reader to carry the
> changelog's gcc-invisible-reference rationale into a short comment above
> the #if defined(__clang__), and to note why the last three cases need
> __BPF_FEATURE_STACK_ARGUMENT (and maybe label the two #endif closures)?

stack argument is implemented in llvm23, and that is why we want this
feature gating.

>
> The sibling file aggregate_ret_func.c documents its equivalent gate:
>
>    /*
>     * gcc returns a by-value struct through a hidden pointer, and emits the
>     * 'r0 = r1' returning it after the __naked body's exit, leaving the
>     * subprogram falling through. Build these with clang only.
>     */
>    #if defined(__clang__)
>
> and other progs files label the closing directive, for example
> verifier_ldsx.c uses #endif /* __BPF_FEATURE_ADDR_SPACE_CAST */.

This is fine. We do not want to have this comment in many places.
The commit message should explain this.

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


  reply	other threads:[~2026-09-11  5:37 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-09  6:25 [PATCH bpf-next v2 00/12] bpf: Support by-value struct and __int128 arguments Yonghong Song
2026-09-09  6:25 ` [PATCH bpf-next v2 01/12] selftests/bpf: Add a test for an __int128 by-value argument Yonghong Song
2026-09-09  7:13   ` bot+bpf-ci
2026-09-11  4:25     ` Yonghong Song
2026-09-09  6:25 ` [PATCH bpf-next v2 02/12] bpf: Index global function arguments by argument slot Yonghong Song
2026-09-09  7:13   ` bot+bpf-ci
2026-09-11  4:27     ` Yonghong Song
2026-09-09  6:25 ` [PATCH bpf-next v2 03/12] bpf: Support by-value struct arguments up to 16 bytes Yonghong Song
2026-09-09  7:13   ` bot+bpf-ci
2026-09-11  4:29     ` Yonghong Song
2026-09-09  6:25 ` [PATCH bpf-next v2 04/12] bpf: Support __int128 as a by-value function argument Yonghong Song
2026-09-09  6:25 ` [PATCH bpf-next v2 05/12] bpf: Rename bpf_call_summary::num_params to arg_slot_cnt Yonghong Song
2026-09-09  6:25 ` [PATCH bpf-next v2 06/12] bpf: Recognize by-value struct and __int128 kfunc arguments Yonghong Song
2026-09-09  6:46   ` sashiko-bot
2026-09-11  4:31     ` Yonghong Song
2026-09-09  6:25 ` [PATCH bpf-next v2 07/12] bpf: Prepare kfunc arguments for the JIT from an ABI description Yonghong Song
2026-09-09  6:46   ` sashiko-bot
2026-09-11  5:05     ` Yonghong Song
2026-09-09  6:26 ` [PATCH bpf-next v2 08/12] bpf, x86: Move kfunc arguments into the x86-64 calling convention Yonghong Song
2026-09-09  7:29   ` bot+bpf-ci
2026-09-11  5:32     ` Yonghong Song
2026-09-09  6:26 ` [PATCH bpf-next v2 09/12] bpf, arm64: Move kfunc arguments into the arm64 " Yonghong Song
2026-09-09  7:30   ` bot+bpf-ci
2026-09-11  5:34     ` Yonghong Song
2026-09-09  6:26 ` [PATCH bpf-next v2 10/12] selftests/bpf: Add C tests for by-value arguments up to 16 bytes Yonghong Song
2026-09-09  6:26 ` [PATCH bpf-next v2 11/12] selftests/bpf: Add inline-asm tests for by-value arguments Yonghong Song
2026-09-09  7:30   ` bot+bpf-ci
2026-09-11  5:37     ` Yonghong Song [this message]
2026-09-09  6:26 ` [PATCH bpf-next v2 12/12] selftests/bpf: Add tests for by-value kfunc arguments Yonghong Song
2026-09-09  7:30   ` bot+bpf-ci
2026-09-11  5:57     ` 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=f4454509-b84c-4923-9983-11bc1518a4f8@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 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.