netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next v1 0/4] Support bpf trampoline for RV64
@ 2023-02-15 13:52 Pu Lehui
  2023-02-15 13:52 ` [PATCH bpf-next v1 1/4] riscv: Extend patch_text for multiple instructions Pu Lehui
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Pu Lehui @ 2023-02-15 13:52 UTC (permalink / raw)
  To: bpf, linux-riscv, netdev, linux-kernel
  Cc: Björn Töpel, Alexei Starovoitov, Daniel Borkmann,
	Andrii Nakryiko, Martin KaFai Lau, Song Liu, Yonghong Song,
	John Fastabend, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
	Palmer Dabbelt, Conor Dooley, Guo Ren, Luke Nelson, Xi Wang,
	Pu Lehui, Pu Lehui

BPF trampoline is the critical infrastructure of the bpf
subsystem, acting as a mediator between kernel functions
and BPF programs. Numerous important features, such as
using ebpf program for zero overhead kernel introspection,
rely on this key component. We can't wait to support bpf
trampoline on RV64. Since RV64 does not support ftrace
direct call yet, the current RV64 bpf trampoline is only
used in bpf context.

As most of riscv cpu support unaligned memory accesses,
we temporarily use patch [1] to facilitate testing. The
test results are as follow, and test_verifier with no
new failure ceses.

- fexit_bpf2bpf:OK
- dummy_st_ops:OK
- xdp_bpf2bpf:OK

[1] https://lore.kernel.org/linux-riscv/20210916130855.4054926-2-chenhuang5@huawei.com/

v1:
- Remove the logic of bpf_arch_text_poke supported for
  kernel functions. (Kuohai and Björn)
- Extend patch_text for multiple instructions. (Björn)
- Fix OOB issue when image too big. (Björn)

RFC:
https://lore.kernel.org/bpf/20230103090756.1993820-1-pulehui@huaweicloud.com/

Pu Lehui (4):
  riscv: Extend patch_text for multiple instructions
  riscv, bpf: Factor out emit_call for kernel and bpf context
  riscv, bpf: Add bpf_arch_text_poke support for RV64
  riscv, bpf: Add bpf trampoline support for RV64

 arch/riscv/include/asm/patch.h     |   2 +-
 arch/riscv/kernel/patch.c          |  19 +-
 arch/riscv/kernel/probes/kprobes.c |  15 +-
 arch/riscv/net/bpf_jit.h           |   5 +
 arch/riscv/net/bpf_jit_comp64.c    | 437 +++++++++++++++++++++++++++--
 5 files changed, 444 insertions(+), 34 deletions(-)

-- 
2.25.1


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

end of thread, other threads:[~2023-02-18  1:30 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-15 13:52 [PATCH bpf-next v1 0/4] Support bpf trampoline for RV64 Pu Lehui
2023-02-15 13:52 ` [PATCH bpf-next v1 1/4] riscv: Extend patch_text for multiple instructions Pu Lehui
2023-02-15 22:37   ` Conor Dooley
2023-02-16  1:18     ` Pu Lehui
2023-02-15 13:52 ` [PATCH bpf-next v1 2/4] riscv, bpf: Factor out emit_call for kernel and bpf context Pu Lehui
2023-02-15 13:52 ` [PATCH bpf-next v1 3/4] riscv, bpf: Add bpf_arch_text_poke support for RV64 Pu Lehui
2023-02-15 13:52 ` [PATCH bpf-next v1 4/4] riscv, bpf: Add bpf trampoline " Pu Lehui
2023-02-15 14:45 ` [PATCH bpf-next v1 0/4] Support bpf trampoline " Björn Töpel
2023-02-16  1:23   ` Pu Lehui
2023-02-16  9:56 ` Björn Töpel
2023-02-17 20:49   ` Daniel Borkmann
2023-02-18  1:30     ` Pu Lehui

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).