-
Notifications
You must be signed in to change notification settings - Fork 147
Fix two tailcall-related issues #9231
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
Conversation
Upstream branch: c4b1be9 |
29dabce
to
e4c7a26
Compare
Upstream branch: 26d0e53 |
cd40ace
to
f95d8b5
Compare
e4c7a26
to
2917a29
Compare
Upstream branch: 0df1a55 |
f95d8b5
to
9d88f12
Compare
2917a29
to
cbe2f3c
Compare
Upstream branch: cce3fee |
9d88f12
to
6e49da5
Compare
cbe2f3c
to
a6d5592
Compare
Upstream branch: 1230be8 |
6e49da5
to
0e2ea17
Compare
a6d5592
to
9362e73
Compare
Upstream branch: 212ec92 |
0e2ea17
to
a12940e
Compare
9362e73
to
d0d73c5
Compare
Upstream branch: 621af19 |
a12940e
to
bf36eca
Compare
d0d73c5
to
6fbb3d3
Compare
Upstream branch: 564606f |
bf36eca
to
7dd92d3
Compare
6fbb3d3
to
08dbf36
Compare
Upstream branch: 38d95be |
7dd92d3
to
bf06e5c
Compare
08dbf36
to
cc01c15
Compare
23a6485
to
3f6e3a7
Compare
2e0a6b9
to
300ac62
Compare
Upstream branch: ad97cb2 |
3f6e3a7
to
3b3103c
Compare
128441d
to
f818fa8
Compare
Upstream branch: ea2aecd |
3b3103c
to
4a58686
Compare
f818fa8
to
d1180f2
Compare
Upstream branch: e860a98 |
4a58686
to
41cdce5
Compare
Upstream branch: e860a98 |
41cdce5
to
c08f2b8
Compare
d1180f2
to
a3964d2
Compare
Upstream branch: 1f48966 |
…emit_bpf_tail_call function The extra pass of bpf_int_jit_compile() skips JIT context initialization which essentially skips offset calculation leaving 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] Fixes: 5dc6155 ("LoongArch: Add BPF JIT support") Signed-off-by: Haoran Jiang <[email protected]> Reviewed-by: Hengqi Chen <[email protected]>
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. Fixes: bb035ef ("LoongArch: BPF: Support mixing bpf2bpf and tailcalls") Fixes: 5dc6155 ("LoongArch: Add BPF JIT support") Signed-off-by: Haoran Jiang <[email protected]>
c08f2b8
to
a61bd40
Compare
a3964d2
to
ec33c8e
Compare
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=979921 irrelevant now. Closing PR. |
Pull request for series with
subject: Fix two tailcall-related issues
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=977599