All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vineet Gupta <vineet.gupta@linux.dev>
To: bot+bpf-ci@kernel.org, bpf@vger.kernel.org
Cc: ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org,
	eddyz87@gmail.com, memxor@gmail.com, martin.lau@linux.dev,
	song@kernel.org, yonghong.song@linux.dev, jolsa@kernel.org,
	emil@etsalapatis.com, ihor.solodrai@linux.dev,
	john.fastabend@gmail.com, shuah@kernel.org,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
	jose.marchesi@oracle.com, david.faust@oss.qualcomm.com,
	martin.lau@kernel.org, mason@kernel.org
Subject: Re: [PATCH bpf-next v2 1/8] selftests/bpf: Build callx tests with GCC that defines __BPF_FEATURE_CALLX
Date: Wed, 28 Oct 2026 15:28:33 -0700	[thread overview]
Message-ID: <29d16b30-bc19-4865-86a7-1611c8407a12@linux.dev> (raw)
In-Reply-To: <3833268383adcd104d44051cbbb7687180f4e13bcccb0057e8747f2e10a5ad68@mail.kernel.org>

  10/28/26 2:22 PM, bot+bpf-ci@kernel.org wrote:
>> selftests/bpf: Build callx tests with GCC that defines __BPF_FEATURE_CALLX
> TL;DR:
> - data_in_arena.c use_ops() isn't converted to CAN_USE_CALLX, so GCC with
>    callx support may still call add1() directly; commit message claims all
>    tests converted
> - Commit message typo (nit)
>
>> selftests/bpf: Build callx tests with GCC that defines __BPF_FEATURE_CALLX
>>
>> Commit 7cd1f73b37ea ("selftests/bpf: Fix build of callx tests with GCC")
>> gated the callx progs on __clang__. GCC had indirect call support which was
>> recently refurbished along with a __BPF_FEATURE_CALLX macro [1], so gate
>> on that as well so once this GCC is released, the tests start passing.
>>
>> Put the arch and compiler conditions in a CAN_USE_CALLX macro in
>> bpf_misc.h, and use it all the test programs.
>>
>> While at it, mark the placeholder programs left for unsupported
>> toolchains and arches with __skip(), so they report SKIP rather than OK.
>>
>> [1] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=ffe3ead4a8ad704b557b0cfa4f823df647c65a0d
>>
>> Measured on bpf-next with a stock bpf-gcc that defines
>> __BPF_FEATURE_CALLX, test_progs before and after: 76 subtests run that
>> previously did not exist in the report, 75 OK and one @unpriv SKIP,
>> with no failures.  The two dummy placeholders retire and
>> callx_rodata_lskel goes SKIP -> OK.
>>
>> Signed-off-by: Vineet Gupta <vineet.gupta@linux.dev>
> The commit message says CAN_USE_CALLX is used in all the test programs, but
> use_ops() in progs/data_in_arena.c is not converted.  It still gates its
> indirect call on __clang__ and keeps the same comment this patch removes from
> the other files:
>
> progs/data_in_arena.c:use_ops() {
>      ...
> #ifdef __clang__
> 	return ops.fn(*ops.data) + ops.name[1];
> #else
> 	/* gcc doesn't support indirect calls */
> 	return add1(*ops.data) + ops.name[1];
> #endif
>      ...
> }
>
> With a GCC that defines __BPF_FEATURE_CALLX, doesn't this still take the
> #else branch and call add1() directly?  That means the GCC build never makes
> the callx through a function pointer in .data.rel.ro, and the "gcc doesn't
> support indirect calls" comment is now wrong for that compiler.
>
> A grep for "indirect call" under progs/ and prog_tests/ shows this is the
> only remaining gate.  None of the later patches in the series touch
> data_in_arena.c.
>
> Should use_ops() be converted to CAN_USE_CALLX as well?  That would need
> data_in_arena.c to include bpf_misc.h, and it would add the x86/arm64/riscv64
> arch gate that clang builds of this file don't have today.  Otherwise, could
> the commit message be adjusted so it doesn't say all the test programs were
> converted?

Yes it missed the grep. Will be fixed in v3.
Do note that this also adds the JIT gate which is the right thing to do 
- the prior __clang__ only check would generate callx even for arches 
not supporting callx.



> This isn't a bug, but there is a missing word in the commit message:
>> bpf_misc.h, and use it all the test programs.
> This should read "use it in all the test programs".

Right, will fix that as well.

Thx,
-Vineet

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


  reply	other threads:[~2026-10-28 22:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-28 20:41 [PATCH bpf-next v2 0/8] selftests/bpf: cleanup bpf-gcc runs Vineet Gupta
2026-10-28 20:41 ` [PATCH bpf-next v2 1/8] selftests/bpf: Build callx tests with GCC that defines __BPF_FEATURE_CALLX Vineet Gupta
2026-10-28 21:22   ` bot+bpf-ci
2026-10-28 22:28     ` Vineet Gupta [this message]
2026-10-28 20:41 ` [PATCH bpf-next v2 2/8] selftests/bpf: don't pass clang-only warning flags to GCC Vineet Gupta
2026-10-28 20:41 ` [PATCH bpf-next v2 3/8] selftests/bpf: report SKIP for arena tests a compiler cannot build Vineet Gupta
2026-10-28 20:41 ` [PATCH bpf-next v2 4/8] selftests/bpf: make arena_base() opaque to GCC's -Warray-bounds Vineet Gupta
2026-10-28 20:41 ` [PATCH bpf-next v2 5/8] selftests/bpf: don't report arena tests as passing with an empty body Vineet Gupta
2026-10-28 20:41 ` [PATCH bpf-next v2 6/8] selftests/bpf: cast explicitly in the arena subprog and callback faults Vineet Gupta
2026-10-28 20:41 ` [PATCH bpf-next v2 7/8] selftests/bpf: write the mixed arena/scalar ALU tests in asm Vineet Gupta
2026-10-28 21:22   ` bot+bpf-ci
2026-10-28 23:14     ` Vineet Gupta
2026-10-28 20:41 ` [PATCH bpf-next v2 8/8] selftests/bpf: skip the struct_ops arena tests without compiler support Vineet Gupta

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=29d16b30-bc19-4865-86a7-1611c8407a12@linux.dev \
    --to=vineet.gupta@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=david.faust@oss.qualcomm.com \
    --cc=eddyz87@gmail.com \
    --cc=emil@etsalapatis.com \
    --cc=ihor.solodrai@linux.dev \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=jose.marchesi@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=martin.lau@kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=mason@kernel.org \
    --cc=memxor@gmail.com \
    --cc=shuah@kernel.org \
    --cc=song@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.