BPF List
 help / color / mirror / Atom feed
* [PATCH bpf-next v2 0/4] Add BPF JIT support for LoongArch
@ 2022-08-30 11:10 Tiezhu Yang
  2022-08-30 11:10 ` [PATCH bpf-next v2 1/4] LoongArch: Move {signed,unsigned}_imm_check() to inst.h Tiezhu Yang
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Tiezhu Yang @ 2022-08-30 11:10 UTC (permalink / raw)
  To: Huacai Chen, Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko
  Cc: bpf, loongarch

The basic support for LoongArch has been merged into the upstream Linux
kernel since 5.19-rc1 on June 5, 2022, this patch series adds BPF JIT
support for LoongArch.

Here is the LoongArch documention:
https://www.kernel.org/doc/html/latest/loongarch/index.html

With this patch series, the test cases in lib/test_bpf.ko have passed
on LoongArch.

  # echo 1 > /proc/sys/net/core/bpf_jit_enable
  # modprobe test_bpf
  # dmesg | grep Summary
  test_bpf: Summary: 1026 PASSED, 0 FAILED, [1014/1014 JIT'ed]
  test_bpf: test_tail_calls: Summary: 10 PASSED, 0 FAILED, [10/10 JIT'ed]
  test_bpf: test_skb_segment: Summary: 2 PASSED, 0 FAILED

It seems that this patch series can not be applied cleanly to bpf-next
which is not synced to v6.0-rc3.

v2:
  -- Rebased series on v6.0-rc3
  -- Make build_epilogue() static
  -- Use alsl.d, bstrpick.d, [ld/st]ptr.[w/d] to save some instructions
  -- Replace move_imm32() and move_imm64() with move_imm() and optimize it
  -- Add code comments to explain the considerations of conditional jump

v1:
  -- Rebased series on v6.0-rc1
  -- Move {signed,unsigned}_imm_check() to inst.h
  -- Define the imm field as "unsigned int" in the instruction format
  -- Use DEF_EMIT_*_FORMAT to define the same kind of instructions
  -- Use "stack_adjust += sizeof(long) * 8" in build_prologue()
  https://lore.kernel.org/bpf/1660996260-11337-1-git-send-email-yangtiezhu@loongson.cn/

RFC:
  https://lore.kernel.org/bpf/1660013580-19053-1-git-send-email-yangtiezhu@loongson.cn/

Tiezhu Yang (4):
  LoongArch: Move {signed,unsigned}_imm_check() to inst.h
  LoongArch: Add some instruction opcodes and formats
  LoongArch: Add BPF JIT support
  LoongArch: Enable BPF_JIT and TEST_BPF in default config

 arch/loongarch/Kbuild                      |    1 +
 arch/loongarch/Kconfig                     |    1 +
 arch/loongarch/configs/loongson3_defconfig |    2 +
 arch/loongarch/include/asm/inst.h          |  383 ++++++++-
 arch/loongarch/kernel/module.c             |   10 -
 arch/loongarch/net/Makefile                |    7 +
 arch/loongarch/net/bpf_jit.c               | 1160 ++++++++++++++++++++++++++++
 arch/loongarch/net/bpf_jit.h               |  282 +++++++
 8 files changed, 1831 insertions(+), 15 deletions(-)
 create mode 100644 arch/loongarch/net/Makefile
 create mode 100644 arch/loongarch/net/bpf_jit.c
 create mode 100644 arch/loongarch/net/bpf_jit.h

-- 
2.1.0


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

end of thread, other threads:[~2022-09-01  1:31 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-30 11:10 [PATCH bpf-next v2 0/4] Add BPF JIT support for LoongArch Tiezhu Yang
2022-08-30 11:10 ` [PATCH bpf-next v2 1/4] LoongArch: Move {signed,unsigned}_imm_check() to inst.h Tiezhu Yang
2022-08-30 11:10 ` [PATCH bpf-next v2 2/4] LoongArch: Add some instruction opcodes and formats Tiezhu Yang
2022-08-30 11:10 ` [PATCH bpf-next v2 3/4] LoongArch: Add BPF JIT support Tiezhu Yang
2022-08-30 11:10 ` [PATCH bpf-next v2 4/4] LoongArch: Enable BPF_JIT and TEST_BPF in default config Tiezhu Yang
2022-08-30 14:46   ` Huacai Chen
2022-08-31  1:23     ` Tiezhu Yang
2022-08-31  4:12       ` Xi Ruoyao
2022-08-31  9:02         ` Xi Ruoyao
2022-08-31 19:31           ` Daniel Borkmann
2022-09-01  1:30             ` Tiezhu Yang

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