BPF List
 help / color / mirror / Atom feed
* [PATCH 0/2] Allow mixing bpf2bpf calls with tailcalls on LoongArch
@ 2023-02-12  3:52 Hengqi Chen
  2023-02-12  3:52 ` [PATCH 1/2] LoongArch: BPF: Treat function address as 64-bit value Hengqi Chen
  2023-02-12  3:52 ` [PATCH 2/2] LoongArch: BPF: Support mixing bpf2bpf and tailcalls Hengqi Chen
  0 siblings, 2 replies; 6+ messages in thread
From: Hengqi Chen @ 2023-02-12  3:52 UTC (permalink / raw)
  To: bpf, loongarch; +Cc: hengqi.chen

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-02-14 15:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-12  3:52 [PATCH 0/2] Allow mixing bpf2bpf calls with tailcalls on LoongArch Hengqi Chen
2023-02-12  3:52 ` [PATCH 1/2] LoongArch: BPF: Treat function address as 64-bit value Hengqi Chen
2023-02-13  3:01   ` Tiezhu Yang
2023-02-13  3:18     ` Tiezhu Yang
2023-02-14 15:36     ` Hengqi Chen
2023-02-12  3:52 ` [PATCH 2/2] LoongArch: BPF: Support mixing bpf2bpf and tailcalls Hengqi Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox