Skip to content

Commit f381bf6

Browse files
daviddaneyralfbaechle
authored andcommitted
MIPS: Add support for eBPF JIT.
Since the eBPF machine has 64-bit registers, we only support this in 64-bit kernels. As of the writing of this commit log test-bpf is showing: test_bpf: Summary: 316 PASSED, 0 FAILED, [308/308 JIT'ed] All current test cases are successfully compiled. Many examples in samples/bpf are usable, specifically tracex5 which uses tail calls works. Signed-off-by: David Daney <david.daney@cavium.com> Cc: Alexei Starovoitov <ast@kernel.org> Cc: Daniel Borkmann <daniel@iogearbox.net> Cc: Markos Chandras <markos.chandras@imgtec.com> Cc: Matt Redfearn <matt.redfearn@imgtec.com> Cc: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/16369/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
1 parent dc19012 commit f381bf6

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

arch/mips/Kconfig

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ config MIPS
3333
select HAVE_ARCH_SECCOMP_FILTER
3434
select HAVE_ARCH_TRACEHOOK
3535
select HAVE_ARCH_TRANSPARENT_HUGEPAGE if CPU_SUPPORTS_HUGEPAGES && 64BIT
36-
select HAVE_CBPF_JIT if !CPU_MICROMIPS
36+
select HAVE_CBPF_JIT if (!64BIT && !CPU_MICROMIPS)
37+
select HAVE_EBPF_JIT if (64BIT && !CPU_MICROMIPS)
3738
select HAVE_CC_STACKPROTECTOR
3839
select HAVE_CONTEXT_TRACKING
3940
select HAVE_COPY_THREAD_TLS
@@ -1178,6 +1179,15 @@ config SYS_SUPPORTS_RELOCATABLE
11781179
The platform must provide plat_get_fdt() if it selects CONFIG_USE_OF
11791180
to allow access to command line and entropy sources.
11801181

1182+
config MIPS_CBPF_JIT
1183+
def_bool y
1184+
depends on BPF_JIT && HAVE_CBPF_JIT
1185+
1186+
config MIPS_EBPF_JIT
1187+
def_bool y
1188+
depends on BPF_JIT && HAVE_EBPF_JIT
1189+
1190+
11811191
#
11821192
# Endianness selection. Sufficiently obscure so many users don't know what to
11831193
# answer,so we try hard to limit the available choices. Also the use of a

arch/mips/net/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# MIPS networking code
22

3-
obj-$(CONFIG_BPF_JIT) += bpf_jit.o bpf_jit_asm.o
3+
obj-$(CONFIG_MIPS_CBPF_JIT) += bpf_jit.o bpf_jit_asm.o
4+
obj-$(CONFIG_MIPS_EBPF_JIT) += ebpf_jit.o

0 commit comments

Comments
 (0)