[PATCH v2 0/4] Optimize BPF tailcall for LoongArch
From: Tiezhu Yang
Date: Sun Jul 05 2026 - 23:39:21 EST
Based on 7.2-rc1, tested on a Loongson-3A6000 physical machine.
This version addresses the review comments of AI, changes are isolated
to patch 3/4, the rest of the series remains unchanged.
v1 -> v2:
- [Patch 3/4] Use ctx->image to inject a safe dummy offset during
Pass 1, safely bypassing the 16-bit signed immediate range check.
- [Patch 3/4] Update the commit message to reflect the new code.
Here are the test results:
$ sudo modprobe test_bpf test_suite=test_tail_calls
$ dmesg -t | tail -1
test_bpf: test_tail_calls: Summary: 10 PASSED, 0 FAILED, [10/10 JIT'ed]
$ sudo ./test_progs -t tailcalls | tail -1
Summary: 1/37 PASSED, 0 SKIPPED, 0 FAILED
Tiezhu Yang (4):
LoongArch: BPF: Optimize redundant TCC loads in epilogue
LoongArch: BPF: Move arena register slot below TCC context
LoongArch: BPF: Refactor jump offset calculation in tail call
LoongArch: BPF: Implement branchless conditional move for TCC
arch/loongarch/include/asm/inst.h | 6 ++
arch/loongarch/net/bpf_jit.c | 112 +++++++++++++++---------------
2 files changed, 63 insertions(+), 55 deletions(-)
--
2.42.0