lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Sun,  3 Feb 2019 12:51:28 +0100
From:   bjorn.topel@...il.com
To:     linux-riscv@...ts.infradead.org, daniel@...earbox.net,
        ast@...nel.org, netdev@...r.kernel.org
Cc:     Björn Töpel <bjorn.topel@...il.com>,
        palmer@...ive.com, hch@...radead.org
Subject: [PATCH bpf-next 0/3] Add RISC-V (RV64G) BPF JIT

From: Björn Töpel <bjorn.topel@...il.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

Powered by blists - more mailing lists