-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpf: Fix test verif_scale_strobemeta_subprogs failure due to llvm19 #6414
Conversation
Upstream branch: e55dad1 |
83205ae
to
0938478
Compare
Upstream branch: a7170d8 |
35b5dd1
to
c9ccb34
Compare
Upstream branch: a7170d8 |
c9ccb34
to
bc97516
Compare
0938478
to
19b93fe
Compare
Upstream branch: 2e7f18a |
bc97516
to
5e6831d
Compare
19b93fe
to
e96765c
Compare
Upstream branch: a7170d8 |
5e6831d
to
dc037d1
Compare
e96765c
to
c8d202e
Compare
Upstream branch: 68bc61c |
dc037d1
to
bf184d9
Compare
c8d202e
to
58cae51
Compare
Upstream branch: 68bc61c |
bf184d9
to
d0bf4c3
Compare
58cae51
to
1659413
Compare
Upstream branch: 68bc61c |
d0bf4c3
to
bfa519d
Compare
1659413
to
e6cf751
Compare
Upstream branch: fc1c9e4 |
bfa519d
to
848aa3e
Compare
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=824476 expired. Closing PR. |
Upstream branch: a4561f5 |
848aa3e
to
e96dea4
Compare
e189d8e
to
678eed0
Compare
Upstream branch: 57354f5 |
With latest llvm19, I hit the following selftest failures with $ ./test_progs -j libbpf: prog 'on_event': BPF program load failed: Permission denied libbpf: prog 'on_event': -- BEGIN PROG LOAD LOG -- combined stack size of 4 calls is 544. Too large verification time 1344153 usec stack depth 24+440+0+32 processed 51008 insns (limit 1000000) max_states_per_insn 19 total_states 1467 peak_states 303 mark_read 146 -- END PROG LOAD LOG -- libbpf: prog 'on_event': failed to load: -13 libbpf: failed to load object 'strobemeta_subprogs.bpf.o' scale_test:FAIL:expect_success unexpected error: -13 (errno 13) #498 verif_scale_strobemeta_subprogs:FAIL The verifier complains too big of the combined stack size (544 bytes) which exceeds the maximum stack limit 512. This is a regression from llvm19 ([1]). In the above error log, the original stack depth is 24+440+0+32. To satisfy interpreter's need, in verifier the stack depth is adjusted to 32+448+32+32=544 which exceeds 512, hence the error. The same adjusted stack size is also used for jit case. But the jitted codes could use smaller stack size. $ egrep -r stack_depth | grep round_up arm64/net/bpf_jit_comp.c: ctx->stack_size = round_up(prog->aux->stack_depth, 16); loongarch/net/bpf_jit.c: bpf_stack_adjust = round_up(ctx->prog->aux->stack_depth, 16); powerpc/net/bpf_jit_comp.c: cgctx.stack_size = round_up(fp->aux->stack_depth, 16); riscv/net/bpf_jit_comp32.c: round_up(ctx->prog->aux->stack_depth, STACK_ALIGN); riscv/net/bpf_jit_comp64.c: bpf_stack_adjust = round_up(ctx->prog->aux->stack_depth, 16); s390/net/bpf_jit_comp.c: u32 stack_depth = round_up(fp->aux->stack_depth, 8); sparc/net/bpf_jit_comp_64.c: stack_needed += round_up(stack_depth, 16); x86/net/bpf_jit_comp.c: EMIT3_off32(0x48, 0x81, 0xEC, round_up(stack_depth, 8)); x86/net/bpf_jit_comp.c: int tcc_off = -4 - round_up(stack_depth, 8); x86/net/bpf_jit_comp.c: round_up(stack_depth, 8)); x86/net/bpf_jit_comp.c: int tcc_off = -4 - round_up(stack_depth, 8); x86/net/bpf_jit_comp.c: EMIT3_off32(0x48, 0x81, 0xC4, round_up(stack_depth, 8)); In the above, STACK_ALIGN in riscv/net/bpf_jit_comp32.c is defined as 16. So stack is aligned in either 8 or 16, x86/s390 having 8-byte stack alignment and the rest having 16-byte alignment. This patch calculates total stack depth based on 16-byte alignment if jit is requested. For the above failing case, the new stack size will be 32+448+0+32=512 and no verification failure. llvm19 regression will be discussed separately in llvm upstream. The verifier change caused three test failures as these tests compared messages with stack size. More specifically, - test_global_funcs/global_func1: fail with interpreter mode and success with jit mode. Adjusted stack sizes so both jit and interpreter modes will fail. - async_stack_depth/{pseudo_call_check, async_call_root_check}: since jit and interpreter will calculate different stack sizes, the failure msg is adjusted to omit those specific stack size numbers. [1] https://lore.kernel.org/bpf/32bde0f0-1881-46c9-931a-673be566c61d@linux.dev/ Suggested-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: Yonghong Song <yonghong.song@linux.dev>
e96dea4
to
1b44265
Compare
678eed0
to
c7a28df
Compare
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=826182 irrelevant now. Closing PR. |
Pull request for series with
subject: bpf: Fix test verif_scale_strobemeta_subprogs failure due to llvm19
version: 2
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=824191