Skip to content

Allow mixing bpf2bpf calls with tailcalls on LoongArch

Hengqi Chen bpf loongarch 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2LoongArch: BPF: Treat function address as 64-bit valuearch/loongarch/net/bpf_jit.c+22 -13 replies
2/2LoongArch: BPF: Support mixing bpf2bpf and tailcallsarch/loongarch/net/bpf_jit.c+6 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] Allow mixing bpf2bpf calls with tailcalls on LoongArch

This patchset enables mixing bpf2bpf calls with tailcalls on LoongArch.

The first patch fixes JIT for function calls, like:

  [   29.346981] multi-func JIT bug 105 != 103

This is because we are emiting variable instructions for 64-bit immediate moves. During the first pass of JIT, the placeholder address is just zero, emiting two instructions for it. In the extra pass, the function address is in XKVRANGE, emiting four instructions for it. This change the instruction index in JIT context. Fix it by using a fixed 4-instruction sequence.

The second patch enables mixing bpf2bpf calls with tailcalls on LoongArch.

Hengqi Chen (2):
LoongArch: BPF: Treat function address as 64-bit value
LoongArch: BPF: Support mixing bpf2bpf and tailcalls

 arch/loongarch/net/bpf_jit.c | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

--
2.31.1