* Re: [PATCH bpf-next] selftests/bpf: Run all summarization freplace cases
2026-11-18 7:33 [PATCH bpf-next] selftests/bpf: Run all summarization freplace cases Yun Lu
@ 2026-11-18 8:12 ` bot+bpf-ci
2026-11-19 1:49 ` Alexei Starovoitov
1 sibling, 0 replies; 4+ messages in thread
From: bot+bpf-ci @ 2026-11-18 8:12 UTC (permalink / raw)
To: luyun_611, andrii, eddyz87, ihor.solodrai, ast, daniel, memxor,
martin.lau, song, yonghong.song, jolsa, emil, shuah
Cc: bpf, linux-kselftest, ast, andrii, daniel, martin.lau, eddyz87,
yonghong.song, mason, ihor.solodrai
[-- Attachment #1: Type: text/plain, Size: 3155 bytes --]
> selftests/bpf: Run all summarization freplace cases
TL;DR: The four newly enabled sleepable freplace selftests will likely fail on
arm64 and s390, because main_might_sleep and main_does_not_sleep lack
__arg_ctx and the extension is rejected; they only work on x86.
> diff --git a/tools/testing/selftests/bpf/prog_tests/summarization.c b/tools/testing/selftests/bpf/prog_tests/summarization.c
> --- a/tools/testing/selftests/bpf/prog_tests/summarization.c
> +++ b/tools/testing/selftests/bpf/prog_tests/summarization.c
[ ... ]
> @@ -116,9 +116,9 @@ void test_summarization_freplace(void)
> };
> char buf[64];
>
> - for (int t = 0; t < 2; t++) {
> - for (int i = 0; i < ARRAY_SIZE(mains); ++i) {
> - for (int j = 0; j < ARRAY_SIZE(replacements); ++j) {
> + for (int t = 0; t < ARRAY_SIZE(mains); t++) {
> + for (int i = 0; i < ARRAY_SIZE(mains[t]); ++i) {
> + for (int j = 0; j < ARRAY_SIZE(replacements[t]); ++j) {
The four sleepable cases that now run (main_might_sleep_with_* and
main_does_not_sleep_with_*) look likely to fail on arm64 and s390.
The replaced main programs in progs/summarization.c take an untagged
pt_regs pointer:
SEC("?uprobe.s")
int main_might_sleep(struct pt_regs *ctx)
SEC("?uprobe.s")
int main_does_not_sleep(struct pt_regs *ctx)
When the target loads, do_check_common() calls btf_prepare_func_args() for
the main function, and the argument is only treated as ARG_PTR_TO_CTX if
btf_is_prog_ctx_type() matches it against bpf_user_pt_regs_t:
- x86: typedef struct pt_regs bpf_user_pt_regs_t, so the name matches.
- arm64: typedef struct user_pt_regs bpf_user_pt_regs_t, which does not
match "pt_regs".
- s390: typedef user_pt_regs bpf_user_pt_regs_t is an anonymous struct, so
the tname is empty and the check fails.
On arm64 and s390 the argument then becomes ARG_PTR_TO_MEM | PTR_MAYBE_NULL
and func_info_aux[0].unreliable is set. libbpf does not rewrite it since
there is no arg:ctx decl tag.
Then bpf_check_attach_target() rejects the extension first:
conservative = aux->func_info_aux[subprog].unreliable;
if (prog_extension) {
if (aux->func_info_aux[subprog].linkage != BTF_FUNC_GLOBAL ||
conservative) {
bpf_log(log, "Cannot replace static functions\n");
return -EINVAL;
}
test_aux() expects the load to fail with "Cannot extend a function that
runs without RCU read lock", and ASSERT_HAS_SUBSTR() on the log will not
find that string. All four subtests would fail on aarch64 and s390x, both
of which are in the BPF CI matrix.
The sleepable subprogram variants avoid this by using
"struct pt_regs *ctx __arg_ctx".
Should main_might_sleep() and main_does_not_sleep() get __arg_ctx on their
arguments (or use bpf_user_pt_regs_t *) so the cases work on every
architecture? As it stands, the claim that the patch "enables four
sleepable-program cases" holds only for x86_64.
---
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/44261555055
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH bpf-next] selftests/bpf: Run all summarization freplace cases
2026-11-18 7:33 [PATCH bpf-next] selftests/bpf: Run all summarization freplace cases Yun Lu
2026-11-18 8:12 ` bot+bpf-ci
@ 2026-11-19 1:49 ` Alexei Starovoitov
2026-11-19 2:09 ` luyun
1 sibling, 1 reply; 4+ messages in thread
From: Alexei Starovoitov @ 2026-11-19 1:49 UTC (permalink / raw)
To: Yun Lu, andrii, eddyz87, ihor.solodrai, daniel, memxor,
martin.lau, song, yonghong.song, jolsa, emil, shuah
Cc: bpf, linux-kselftest
On Tue, Nov 17, 2026 at 11:33 PM Yun Lu <luyun_611@163.com> wrote:
> derive the group count from mains. This restores four packet-data
> cases and enables four sleepable-program cases.
The four sleepable cases will fail on arm64 and s390x.
Their targets have no __arg_ctx:
int main_might_sleep(struct pt_regs *ctx)
int main_does_not_sleep(struct pt_regs *ctx)
pw-bot: cr
^ permalink raw reply [flat|nested] 4+ messages in thread