-
Notifications
You must be signed in to change notification settings - Fork 6
Fix two tailcall-related issues #5544
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
base: bpf-next_base
Are you sure you want to change the base?
Fix two tailcall-related issues #5544
Conversation
Upstream branch: c4b1be9 |
8c57c04
to
b70eeea
Compare
Upstream branch: 26d0e53 |
2055d2c
to
64ba538
Compare
b70eeea
to
21b4b7a
Compare
Upstream branch: 0df1a55 |
64ba538
to
4cc19ae
Compare
21b4b7a
to
7bebef6
Compare
Upstream branch: cce3fee |
4cc19ae
to
bcdfac1
Compare
7bebef6
to
098b57c
Compare
Upstream branch: 1230be8 |
bcdfac1
to
2459d44
Compare
098b57c
to
04b85e4
Compare
Upstream branch: 212ec92 |
2459d44
to
7c3df11
Compare
04b85e4
to
e254fff
Compare
Upstream branch: 621af19 |
7c3df11
to
e9468b9
Compare
e254fff
to
6421a08
Compare
Upstream branch: 564606f |
e9468b9
to
a851c43
Compare
6421a08
to
d84ad1e
Compare
Upstream branch: 38d95be |
…emit_bpf_tail_call function For a ebpf subprog JIT,the last call bpf_int_jit_compile function will directly enter the skip_init_ctx process. At this point, out_offset = -1, the jmp_offset in emit_bpf_tail_call is calculated by #define jmp_offset (out_offset - (cur_offset)) is a negative number, which does not meet expectations.The final generated assembly as follow. 54: bgeu $a2, $t1, -8 # 0x0000004c 58: addi.d $a6, $s5, -1 5c: bltz $a6, -16 # 0x0000004c 60: alsl.d $t2, $a2, $a1, 0x3 64: ld.d $t2, $t2, 264 68: beq $t2, $zero, -28 # 0x0000004c Before apply this patch, the follow test case will reveal soft lock issues. cd tools/testing/selftests/bpf/ ./test_progs --allow=tailcalls/tailcall_bpf2bpf_1 dmesg: watchdog: BUG: soft lockup - CPU#2 stuck for 26s! [test_progs:25056] Signed-off-by: Haoran Jiang <jianghaoran@kylinos.cn>
In specific use cases combining tailcalls and BPF-to-BPF calls, MAX_TAIL_CALL_CNT won't work because of missing tail_call_cnt back-propagation from callee to caller。This patch fixes this tailcall issue caused by abusing the tailcall in bpf2bpf feature on LoongArch like the way of "bpf, x64: Fix tailcall hierarchy". push tail_call_cnt_ptr and tail_call_cnt into the stack, tail_call_cnt_ptr is passed between tailcall and bpf2bpf, uses tail_call_cnt_ptr to increment tail_call_cnt. Signed-off-by: Haoran Jiang <jianghaoran@kylinos.cn>
a851c43
to
295f728
Compare
Pull request for series with
subject: Fix two tailcall-related issues
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=977599