050-v5.16-05-mips-bpf-Enable-eBPF-JITs.patch 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. From: Johan Almbladh <[email protected]>
  2. Date: Tue, 5 Oct 2021 18:54:07 +0200
  3. Subject: [PATCH] mips: bpf: Enable eBPF JITs
  4. This patch enables the new eBPF JITs for 32-bit and 64-bit MIPS. It also
  5. disables the old cBPF JIT to so cBPF programs are converted to use the
  6. new JIT.
  7. Workarounds for R4000 CPU errata are not implemented by the JIT, so the
  8. JIT is disabled if any of those workarounds are configured.
  9. Signed-off-by: Johan Almbladh <[email protected]>
  10. ---
  11. --- a/MAINTAINERS
  12. +++ b/MAINTAINERS
  13. @@ -3431,6 +3431,7 @@ S: Supported
  14. F: arch/arm64/net/
  15. BPF JIT for MIPS (32-BIT AND 64-BIT)
  16. +M: Johan Almbladh <[email protected]>
  17. M: Paul Burton <[email protected]>
  18. L: [email protected]
  19. L: [email protected]
  20. --- a/arch/mips/Kconfig
  21. +++ b/arch/mips/Kconfig
  22. @@ -57,7 +57,6 @@ config MIPS
  23. select HAVE_ARCH_TRACEHOOK
  24. select HAVE_ARCH_TRANSPARENT_HUGEPAGE if CPU_SUPPORTS_HUGEPAGES
  25. select HAVE_ASM_MODVERSIONS
  26. - select HAVE_CBPF_JIT if !64BIT && !CPU_MICROMIPS
  27. select HAVE_CONTEXT_TRACKING
  28. select HAVE_TIF_NOHZ
  29. select HAVE_C_RECORDMCOUNT
  30. @@ -65,7 +64,10 @@ config MIPS
  31. select HAVE_DEBUG_STACKOVERFLOW
  32. select HAVE_DMA_CONTIGUOUS
  33. select HAVE_DYNAMIC_FTRACE
  34. - select HAVE_EBPF_JIT if 64BIT && !CPU_MICROMIPS && TARGET_ISA_REV >= 2
  35. + select HAVE_EBPF_JIT if !CPU_MICROMIPS && \
  36. + !CPU_DADDI_WORKAROUNDS && \
  37. + !CPU_R4000_WORKAROUNDS && \
  38. + !CPU_R4400_WORKAROUNDS
  39. select HAVE_EXIT_THREAD
  40. select HAVE_FAST_GUP
  41. select HAVE_FTRACE_MCOUNT_RECORD
  42. --- a/arch/mips/net/Makefile
  43. +++ b/arch/mips/net/Makefile
  44. @@ -2,9 +2,10 @@
  45. # MIPS networking code
  46. obj-$(CONFIG_MIPS_CBPF_JIT) += bpf_jit.o bpf_jit_asm.o
  47. +obj-$(CONFIG_MIPS_EBPF_JIT) += bpf_jit_comp.o
  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