public inbox for bpf@vger.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,
	jose.marchesi@oracle.com, kernel-team@fb.com,
	martin.lau@kernel.org, eddyz87@gmail.com, clm@meta.com,
	ihor.solodrai@linux.dev
Subject: Re: [PATCH bpf-next v5 07/16] bpf: Reuse MAX_BPF_FUNC_ARGS for maximum number of arguments
Date: Sat, 18 Apr 2026 10:03:26 -0700	[thread overview]
Message-ID: <a3246084-b3dc-48e0-a4fa-e44e6aa3ce68@linux.dev> (raw)
In-Reply-To: <3bc734dfbeffc1c45e1c640be67af1824500aa1b8e04aee814e1942c1064cc96@mail.kernel.org>



On 4/17/26 5:52 PM, bot+bpf-ci@kernel.org wrote:
>> diff --git a/include/linux/bpf.h b/include/linux/bpf.h
>> --- a/include/linux/bpf.h
>> +++ b/include/linux/bpf.h
>> @@ -1151,6 +1151,10 @@ struct bpf_prog_offload {
>>
>> -/* The longest tracepoint has 12 args.
>> +/* The longest tracepoint has 12 args.
> This isn't a bug, but the multi-line comment opening doesn't follow BPF
> subsystem style. Per bpf.md: 'Multi-line comments MUST have the opening
> /* on its own line'. The rule applies even if surrounding code uses the
> old style.
>
> Should this be reformatted as:
>
> /*
>   * The longest tracepoint has 12 args.
>   * See include/trace/bpf_probe.h
>   *
>   * Also reuse this macro for maximum number of arguments a BPF function
>   * or a kfunc can have. Args 1-5 are passed in registers, args 6-12 via
>   * stack arg slots.
>   */
>
>>   * See include/trace/bpf_probe.h
>> + *
>> + * Also reuse this macro for maximum number of arguments a BPF function
>> + * or a kfunc can have. Args 1-5 are passed in registers, args 6-12 via
> Should this say "kfuncs" instead of "kfunc's"? The context is plural
> (referring to multiple functions), not possessive.
>
> Additionally, bot+bpf-ci@kernel.org raised a concern in v5 about the
> calling convention description. The comment states "Args 1-5 are passed
> in registers, args 6-12 via stack arg slots," but argument 6 is actually
> passed in the R9 register, not on the stack.
>
> Looking at arch/x86/net/bpf_jit_comp.c, the existing comment states:
> "x86-64 supports up to MAX_BPF_FUNC_ARGS arguments. 1-6 are passed
> through regs, the remains are through stack."
>
> The follow-up commit 0ef907c3ec2c in this patch series documents the
> actual calling convention as: "Follow x86-64 calling convention for both
> BPF-to-BPF and kfunc calls: - Arg 6 is passed in the R9 register - Args
> 7+ are passed on the stack at [rsp]"
>
> Should the comment say "Args 1-5 are passed in registers, arg 6 in R9
> register, args 7-12 via stack arg slots" instead?

See previous comment:

The JIT may map some stack arg slots to registers based on the native calling
convention (e.g., arg 6 to R9 on x86-64).

This should clarify.

>
> Reference: https://lore.kernel.org/bpf/d23db60b9c7e22d8ab443688b4f2da8d5594d6c07698cdc282faccaade757430@mail.kernel.org/
>
>> + * stack arg slots.
>>   */
>>   #define MAX_BPF_FUNC_ARGS 12
>>
>
> ---
> 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/24592562564


  reply	other threads:[~2026-04-18 17:03 UTC|newest]

Thread overview: 73+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-17  3:46 [PATCH bpf-next v5 00/16] bpf: Support stack arguments for BPF functions and kfuncs Yonghong Song
2026-04-17  3:47 ` [PATCH bpf-next v5 01/16] bpf: Remove unused parameter from check_map_kptr_access() Yonghong Song
2026-04-17  3:47 ` [PATCH bpf-next v5 02/16] bpf: Refactor to avoid redundant calculation of bpf_reg_state Yonghong Song
2026-04-17  3:47 ` [PATCH bpf-next v5 03/16] bpf: Refactor to handle memory and size together Yonghong Song
2026-04-17  4:49   ` sashiko-bot
2026-04-18 16:40     ` Yonghong Song
2026-04-18  0:52   ` bot+bpf-ci
2026-04-18 16:47     ` Yonghong Song
2026-04-17  3:47 ` [PATCH bpf-next v5 04/16] bpf: Prepare verifier logs for upcoming kfunc stack arguments Yonghong Song
2026-04-17  3:47 ` [PATCH bpf-next v5 05/16] bpf: Introduce bpf register BPF_REG_PARAMS Yonghong Song
2026-04-17  3:47 ` [PATCH bpf-next v5 06/16] bpf: Limit the scope of BPF_REG_PARAMS usage Yonghong Song
2026-04-17  4:30   ` bot+bpf-ci
2026-04-18 16:48     ` Yonghong Song
2026-04-17  4:50   ` sashiko-bot
2026-04-18 16:50     ` Yonghong Song
2026-04-18  1:04   ` bot+bpf-ci
2026-04-18 16:54     ` Yonghong Song
2026-04-17  3:47 ` [PATCH bpf-next v5 07/16] bpf: Reuse MAX_BPF_FUNC_ARGS for maximum number of arguments Yonghong Song
2026-04-17  4:30   ` bot+bpf-ci
2026-04-18 17:00     ` Yonghong Song
2026-04-18  0:52   ` bot+bpf-ci
2026-04-18 17:03     ` Yonghong Song [this message]
2026-04-17  3:47 ` [PATCH bpf-next v5 08/16] bpf: Support stack arguments for bpf functions Yonghong Song
2026-04-17  4:35   ` sashiko-bot
2026-04-18 17:10     ` Yonghong Song
2026-04-17  4:43   ` bot+bpf-ci
2026-04-18 17:11     ` Yonghong Song
2026-04-18  1:04   ` bot+bpf-ci
2026-04-17  3:47 ` [PATCH bpf-next v5 09/16] bpf: Reject stack arguments in non-JITed programs Yonghong Song
2026-04-17  4:30   ` bot+bpf-ci
2026-04-18 17:17     ` Yonghong Song
2026-04-18  0:52   ` bot+bpf-ci
2026-04-17  3:47 ` [PATCH bpf-next v5 10/16] bpf: Reject stack arguments if tail call reachable Yonghong Song
2026-04-17  4:08   ` sashiko-bot
2026-04-18 17:18     ` Yonghong Song
2026-04-18 17:37     ` Yonghong Song
2026-04-17  4:30   ` bot+bpf-ci
2026-04-18  1:04   ` bot+bpf-ci
2026-04-18 17:24     ` Yonghong Song
2026-04-17  3:47 ` [PATCH bpf-next v5 11/16] bpf: Support stack arguments for kfunc calls Yonghong Song
2026-04-17  4:40   ` sashiko-bot
2026-04-18 17:46     ` Yonghong Song
2026-04-17  4:43   ` bot+bpf-ci
2026-04-18 17:57     ` Yonghong Song
2026-04-18  1:04   ` bot+bpf-ci
2026-04-18 18:04     ` Yonghong Song
2026-04-17  3:47 ` [PATCH bpf-next v5 12/16] bpf: Enable stack argument support for x86_64 Yonghong Song
2026-04-17  4:30   ` bot+bpf-ci
2026-04-17  5:03   ` sashiko-bot
2026-04-18 18:07     ` Yonghong Song
2026-04-18  1:04   ` bot+bpf-ci
2026-04-17  3:48 ` [PATCH bpf-next v5 13/16] bpf,x86: Implement JIT support for stack arguments Yonghong Song
2026-04-17  4:44   ` sashiko-bot
2026-04-18 16:43     ` Puranjay Mohan
2026-04-18 18:15     ` Yonghong Song
2026-04-18  1:20   ` bot+bpf-ci
2026-04-18 18:23     ` Yonghong Song
2026-04-17  3:48 ` [PATCH bpf-next v5 14/16] selftests/bpf: Add tests for BPF function " Yonghong Song
2026-04-17  4:20   ` sashiko-bot
2026-04-18  0:52   ` bot+bpf-ci
2026-04-18 18:26     ` Yonghong Song
2026-04-17  3:48 ` [PATCH bpf-next v5 15/16] selftests/bpf: Add negative test for greater-than-8-byte kfunc stack argument Yonghong Song
2026-04-17  4:28   ` sashiko-bot
2026-04-18 18:29     ` Yonghong Song
2026-04-18  0:52   ` bot+bpf-ci
2026-04-17  3:48 ` [PATCH bpf-next v5 16/16] selftests/bpf: Add verifier tests for stack argument validation Yonghong Song
2026-04-17  4:38   ` sashiko-bot
2026-04-18 18:36     ` Yonghong Song
2026-04-18  0:52   ` bot+bpf-ci
2026-04-18 16:39 ` [PATCH bpf-next v5 00/16] bpf: Support stack arguments for BPF functions and kfuncs Puranjay Mohan
2026-04-18 18:47   ` Alexei Starovoitov
2026-04-18 18:54     ` Yonghong Song
2026-04-18 17:06 ` Puranjay Mohan

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=a3246084-b3dc-48e0-a4fa-e44e6aa3ce68@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=jose.marchesi@oracle.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox