linux-riscv.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/3] Add RISC-V (RV64G) BPF JIT
@ 2019-02-03 11:51 bjorn.topel
  2019-02-03 11:51 ` [PATCH bpf-next 1/3] bpf, riscv: add BPF JIT for RV64G bjorn.topel
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: bjorn.topel @ 2019-02-03 11:51 UTC (permalink / raw)
  To: linux-riscv, daniel, ast, netdev; +Cc: hch, Björn Töpel, palmer

From: Björn Töpel <bjorn.topel@gmail.com>

Hi!

This series adds an RV64G BPF JIT to the kernel. I've sent out a RFC
for a couple of weeks ago, and think this code is
feature-complete/stable enough (famous last words) for a proper patch.

Unfortunately, kprobes isn't supported by RISC-V yet (Patrick Stählin
sent out an RFC last year), which means that all tests involving
BPF_PROG_TYPE_TRACEPOINT, BPF_PROG_TYPE_PERF_EVENT,
BPF_PROG_TYPE_KPROBE and BPF_PROG_TYPE_RAW_TRACEPOINT will fail.

Further, the implementation does not support "far branching" (>4KiB).
    
The implementation passes all the test_bpf.ko tests: test_bpf:
    Summary: 378 PASSED, 0 FAILED, [366/366 JIT'ed]
    
All the tail_call tests in the selftest/bpf/test_verifier program
passes.
    
All tests where done on QEMU emulator version 3.1.50
(v3.1.0-688-g8ae951fbc106). I'll test it on real hardware, when I get
access to it.

I'm routing this patch via bpf-next/netdev mailing list (after a
conversation with Palmer at FOSDEM), mainly because the other JITs
went that path.

Thanks for all the comments!

Cheers,
Björn

RFCv1 -> v1:
* Cleaned up the Kconfig and net/Makefile. (Christoph)
* Removed the entry-stub and squashed the build/config changes to be
  part of the JIT implementation. (Christoph)
* Simplified the register tracking code. (Daniel)
* Removed unused macros. (Daniel)
* Added myself as maintainer and updated documentation. (Daniel)
* Removed HAVE_EFFICIENT_UNALIGNED_ACCESS. (Christoph, Palmer)
* Added tail-calls and cleaned up the code.



Björn Töpel (3):
  bpf, riscv: add BPF JIT for RV64G
  MAINTAINERS: add RISC-V BPF JIT maintainer
  bpf, doc: add RISC-V to filter.txt

 Documentation/networking/filter.txt |   16 +-
 MAINTAINERS                         |    6 +
 arch/riscv/Kconfig                  |    1 +
 arch/riscv/Makefile                 |    2 +-
 arch/riscv/net/Makefile             |    1 +
 arch/riscv/net/bpf_jit_comp.c       | 1502 +++++++++++++++++++++++++++
 6 files changed, 1520 insertions(+), 8 deletions(-)
 create mode 100644 arch/riscv/net/Makefile
 create mode 100644 arch/riscv/net/bpf_jit_comp.c

-- 
2.19.1


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

end of thread, other threads:[~2019-02-04 20:27 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-03 11:51 [PATCH bpf-next 0/3] Add RISC-V (RV64G) BPF JIT bjorn.topel
2019-02-03 11:51 ` [PATCH bpf-next 1/3] bpf, riscv: add BPF JIT for RV64G bjorn.topel
2019-02-03 17:08   ` David Miller
2019-02-04 20:06   ` Daniel Borkmann
2019-02-04 20:27     ` Björn Töpel
2019-02-03 11:51 ` [PATCH bpf-next 2/3] MAINTAINERS: add RISC-V BPF JIT maintainer bjorn.topel
2019-02-03 17:08   ` David Miller
2019-02-03 11:51 ` [PATCH bpf-next 3/3] bpf, doc: add RISC-V to filter.txt bjorn.topel
2019-02-03 17:08   ` David Miller
2019-02-04 20:09   ` Daniel Borkmann
2019-02-04 20:16     ` Björn Töpel

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).