mediatek: Add support for Xiaomi Redmi Router AX6S
[openwrt/staging/mkresin.git] / target / linux / generic / backport-5.4 / 071-v5.16-05-mips-bpf-Enable-eBPF-JITs.patch
1 From: Johan Almbladh <johan.almbladh@anyfinetworks.com>
2 Date: Tue, 5 Oct 2021 18:54:07 +0200
3 Subject: [PATCH] mips: bpf: Enable eBPF JITs
4
5 This patch enables the new eBPF JITs for 32-bit and 64-bit MIPS. It also
6 disables the old cBPF JIT to so cBPF programs are converted to use the
7 new JIT.
8
9 Workarounds for R4000 CPU errata are not implemented by the JIT, so the
10 JIT is disabled if any of those workarounds are configured.
11
12 Signed-off-by: Johan Almbladh <johan.almbladh@anyfinetworks.com>
13 ---
14
15 --- a/MAINTAINERS
16 +++ b/MAINTAINERS
17 @@ -3099,6 +3099,7 @@ S: Supported
18 F: arch/arm64/net/
19
20 BPF JIT for MIPS (32-BIT AND 64-BIT)
21 +M: Johan Almbladh <johan.almbladh@anyfinetworks.com>
22 M: Paul Burton <paulburton@kernel.org>
23 L: netdev@vger.kernel.org
24 L: bpf@vger.kernel.org
25 --- a/arch/mips/Kconfig
26 +++ b/arch/mips/Kconfig
27 @@ -46,8 +46,10 @@ config MIPS
28 select HAVE_ARCH_TRACEHOOK
29 select HAVE_ARCH_TRANSPARENT_HUGEPAGE if CPU_SUPPORTS_HUGEPAGES
30 select HAVE_ASM_MODVERSIONS
31 - select HAVE_CBPF_JIT if !64BIT && !CPU_MICROMIPS
32 - select HAVE_EBPF_JIT if 64BIT && !CPU_MICROMIPS && TARGET_ISA_REV >= 2
33 + select HAVE_EBPF_JIT if !CPU_MICROMIPS && \
34 + !CPU_DADDI_WORKAROUNDS && \
35 + !CPU_R4000_WORKAROUNDS && \
36 + !CPU_R4400_WORKAROUNDS
37 select HAVE_CONTEXT_TRACKING
38 select HAVE_COPY_THREAD_TLS
39 select HAVE_C_RECORDMCOUNT
40 --- a/arch/mips/net/Makefile
41 +++ b/arch/mips/net/Makefile
42 @@ -2,9 +2,10 @@
43 # MIPS networking code
44
45 obj-$(CONFIG_MIPS_CBPF_JIT) += bpf_jit.o bpf_jit_asm.o
46 +obj-$(CONFIG_MIPS_EBPF_JIT) += bpf_jit_comp.o
47
48 ifeq ($(CONFIG_32BIT),y)
49 - obj-$(CONFIG_MIPS_EBPF_JIT) += bpf_jit_comp.o bpf_jit_comp32.o
50 + obj-$(CONFIG_MIPS_EBPF_JIT) += bpf_jit_comp32.o
51 else
52 - obj-$(CONFIG_MIPS_EBPF_JIT) += ebpf_jit.o
53 + obj-$(CONFIG_MIPS_EBPF_JIT) += bpf_jit_comp64.o
54 endif