kernel_optimize_test/arch
Björn Töpel 2353ecc6f9 bpf, riscv: add BPF JIT for RV64G
This commit adds a BPF JIT for RV64G.

The JIT is a two-pass JIT, and has a dynamic prolog/epilogue (similar
to the MIPS64 BPF JIT) instead of static ones (e.g. x86_64).

At the moment the RISC-V Linux port does not support
CONFIG_HAVE_KPROBES, which means that CONFIG_BPF_EVENTS is not
supported. Thus, no tests involving BPF_PROG_TYPE_TRACEPOINT,
BPF_PROG_TYPE_PERF_EVENT, BPF_PROG_TYPE_KPROBE and
BPF_PROG_TYPE_RAW_TRACEPOINT passes.

The implementation does not support "far branching" (>4KiB).

Test results:
  # modprobe test_bpf
  test_bpf: Summary: 378 PASSED, 0 FAILED, [366/366 JIT'ed]

  # echo 1 > /proc/sys/kernel/unprivileged_bpf_disabled
  # ./test_verifier
  ...
  Summary: 761 PASSED, 507 SKIPPED, 2 FAILED

Note that "test_verifier" was run with one build with
CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y and one without, otherwise
many of the the tests that require unaligned access were skipped.

CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y:
  # echo 1 > /proc/sys/kernel/unprivileged_bpf_disabled
  # ./test_verifier | grep -c 'NOTE.*unknown align'
  0

No CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS:
  # echo 1 > /proc/sys/kernel/unprivileged_bpf_disabled
  # ./test_verifier | grep -c 'NOTE.*unknown align'
  59

The two failing test_verifier tests are:
  "ld_abs: vlan + abs, test 1"
  "ld_abs: jump around ld_abs"

This is due to that "far branching" involved in those tests.

All tests where done on QEMU (QEMU emulator version 3.1.50
(v3.1.0-688-g8ae951fbc106)).

Signed-off-by: Björn Töpel <bjorn.topel@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2019-02-05 16:56:10 +01:00
..
alpha sock: Add SO_RCVTIMEO_NEW and SO_SNDTIMEO_NEW 2019-02-03 11:17:31 -08:00
arc ARCv2: lib: memeset: fix doing prefetchw outside of buffer 2019-01-17 16:24:39 -08:00
arm Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2019-01-28 19:38:33 -08:00
arm64 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2019-01-28 19:38:33 -08:00
c6x arch: restore generic-y += shmparam.h for some architectures 2019-01-06 18:16:11 -08:00
csky csky: fixup compile error with CPU 810. 2019-01-10 04:37:37 -08:00
h8300 kbuild: remove unused archmrproper 2019-01-16 23:31:17 +09:00
hexagon arch: restore generic-y += shmparam.h for some architectures 2019-01-06 18:16:11 -08:00
ia64 arch: Use asm-generic/socket.h when possible 2019-02-03 11:17:30 -08:00
m68k arch: restore generic-y += shmparam.h for some architectures 2019-01-06 18:16:11 -08:00
microblaze arch: restore generic-y += shmparam.h for some architectures 2019-01-06 18:16:11 -08:00
mips sock: Add SO_RCVTIMEO_NEW and SO_SNDTIMEO_NEW 2019-02-03 11:17:31 -08:00
nds32 nds32: remove unneeded code in arch/nds32/Makefile 2019-01-17 23:42:37 +09:00
nios2 arch: remove redundant UAPI generic-y defines 2019-01-06 10:22:15 +09:00
openrisc openrisc: remove unneeded code in arch/openrisc/Makefile 2019-01-17 23:42:59 +09:00
parisc sock: Add SO_RCVTIMEO_NEW and SO_SNDTIMEO_NEW 2019-02-03 11:17:31 -08:00
powerpc socket: Rename SO_RCVTIMEO/ SO_SNDTIMEO with _OLD suffixes 2019-02-03 11:17:31 -08:00
riscv bpf, riscv: add BPF JIT for RV64G 2019-02-05 16:56:10 +01:00
s390 s390: bpf: fix JMP32 code-gen 2019-02-04 09:45:09 -08:00
sh Kbuild late updates for v4.21 2019-01-06 16:33:10 -08:00
sparc socket: fix for Add SO_TIMESTAMP[NS]_NEW 2019-02-03 20:36:11 -08:00
um Merge branch 'akpm' (patches from Andrew) 2019-01-05 09:16:18 -08:00
unicore32 arch: restore generic-y += shmparam.h for some architectures 2019-01-06 18:16:11 -08:00
x86 arch: Use asm-generic/socket.h when possible 2019-02-03 11:17:30 -08:00
xtensa arch: Use asm-generic/socket.h when possible 2019-02-03 11:17:30 -08:00
.gitignore
Kconfig jump_label: move 'asm goto' support test to Kconfig 2019-01-06 09:46:51 +09:00