kernel: bump 5.15 to 5.15.96
[openwrt/staging/noltari.git] / target / linux / generic / backport-5.15 / 050-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 @@ -3431,6 +3431,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 @@ -57,7 +57,6 @@ 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_CONTEXT_TRACKING
33 select HAVE_TIF_NOHZ
34 select HAVE_C_RECORDMCOUNT
35 @@ -65,7 +64,10 @@ config MIPS
36 select HAVE_DEBUG_STACKOVERFLOW
37 select HAVE_DMA_CONTIGUOUS
38 select HAVE_DYNAMIC_FTRACE
39 - select HAVE_EBPF_JIT if 64BIT && !CPU_MICROMIPS && TARGET_ISA_REV >= 2
40 + select HAVE_EBPF_JIT if !CPU_MICROMIPS && \
41 + !CPU_DADDI_WORKAROUNDS && \
42 + !CPU_R4000_WORKAROUNDS && \
43 + !CPU_R4400_WORKAROUNDS
44 select HAVE_EXIT_THREAD
45 select HAVE_FAST_GUP
46 select HAVE_FTRACE_MCOUNT_RECORD
47 --- a/arch/mips/net/Makefile
48 +++ b/arch/mips/net/Makefile
49 @@ -2,9 +2,10 @@
50 # MIPS networking code
51
52 obj-$(CONFIG_MIPS_CBPF_JIT) += bpf_jit.o bpf_jit_asm.o
53 +obj-$(CONFIG_MIPS_EBPF_JIT) += bpf_jit_comp.o
54
55 ifeq ($(CONFIG_32BIT),y)
56 - obj-$(CONFIG_MIPS_EBPF_JIT) += bpf_jit_comp.o bpf_jit_comp32.o
57 + obj-$(CONFIG_MIPS_EBPF_JIT) += bpf_jit_comp32.o
58 else
59 - obj-$(CONFIG_MIPS_EBPF_JIT) += ebpf_jit.o
60 + obj-$(CONFIG_MIPS_EBPF_JIT) += bpf_jit_comp64.o
61 endif