riscv, bpf: Add support for far branching
authorBjörn Töpel <bjorn.topel@gmail.com>
Mon, 16 Dec 2019 09:13:36 +0000 (10:13 +0100)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 19 Dec 2019 15:03:30 +0000 (16:03 +0100)
commit7d1ef13fea2b66bb466592a7855b33181c85ec5f
tree3f9ede09afc50ed161f939f27bab5e54a607779e
parentf1003b787c00fbaa4b11619c6b23a885bfce8f07
riscv, bpf: Add support for far branching

This commit adds branch relaxation to the BPF JIT, and with that
support for far (offset greater than 12b) branching.

The branch relaxation requires more than two passes to converge. For
most programs it is three passes, but for larger programs it can be
more.

Signed-off-by: Björn Töpel <bjorn.topel@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Luke Nelson <lukenels@cs.washington.edu>
Link: https://lore.kernel.org/bpf/20191216091343.23260-3-bjorn.topel@gmail.com
arch/riscv/net/bpf_jit_comp.c