bpf: split HAVE_BPF_JIT into cBPF and eBPF variant
authorDaniel Borkmann <daniel@iogearbox.net>
Fri, 13 May 2016 17:08:28 +0000 (19:08 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 16 May 2016 17:49:31 +0000 (13:49 -0400)
Split the HAVE_BPF_JIT into two for distinguishing cBPF and eBPF JITs.

Current cBPF ones:

  # git grep -n HAVE_CBPF_JIT arch/
  arch/arm/Kconfig:44:    select HAVE_CBPF_JIT
  arch/mips/Kconfig:18:   select HAVE_CBPF_JIT if !CPU_MICROMIPS
  arch/powerpc/Kconfig:129:       select HAVE_CBPF_JIT
  arch/sparc/Kconfig:35:  select HAVE_CBPF_JIT

Current eBPF ones:

  # git grep -n HAVE_EBPF_JIT arch/
  arch/arm64/Kconfig:61:  select HAVE_EBPF_JIT
  arch/s390/Kconfig:126:  select HAVE_EBPF_JIT if PACK_STACK && HAVE_MARCH_Z196_FEATURES
  arch/x86/Kconfig:94:    select HAVE_EBPF_JIT                    if X86_64

Later code also needs this facility to check for eBPF JITs.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
arch/arm/Kconfig
arch/arm64/Kconfig
arch/mips/Kconfig
arch/powerpc/Kconfig
arch/s390/Kconfig
arch/sparc/Kconfig
arch/x86/Kconfig
net/Kconfig

index cdfa6c2b7626f3a761364ac072fc359b5f02592a..2315b0d1b4f40ff2cd09a579d8a6f33eab492a77 100644 (file)
@@ -41,7 +41,7 @@ config ARM
        select HAVE_ARCH_SECCOMP_FILTER if (AEABI && !OABI_COMPAT)
        select HAVE_ARCH_TRACEHOOK
        select HAVE_ARM_SMCCC if CPU_V7
-       select HAVE_BPF_JIT
+       select HAVE_CBPF_JIT
        select HAVE_CC_STACKPROTECTOR
        select HAVE_CONTEXT_TRACKING
        select HAVE_C_RECORDMCOUNT
index 4f436220384f847bbdee53cd7a8bce5fa089da61..e6761ea2feec1b4a4ca5c6580dd8f1cffbd036ba 100644 (file)
@@ -58,7 +58,7 @@ config ARM64
        select HAVE_ARCH_MMAP_RND_COMPAT_BITS if COMPAT
        select HAVE_ARCH_SECCOMP_FILTER
        select HAVE_ARCH_TRACEHOOK
-       select HAVE_BPF_JIT
+       select HAVE_EBPF_JIT
        select HAVE_C_RECORDMCOUNT
        select HAVE_CC_STACKPROTECTOR
        select HAVE_CMPXCHG_DOUBLE
index 2018c2b0e078f9880bca0d2bb497e2dd271196d5..3ee1ea61b2dc7b571efe16bc66b133eddfdfed62 100644 (file)
@@ -15,7 +15,7 @@ config MIPS
        select HAVE_ARCH_KGDB
        select HAVE_ARCH_SECCOMP_FILTER
        select HAVE_ARCH_TRACEHOOK
-       select HAVE_BPF_JIT if !CPU_MICROMIPS
+       select HAVE_CBPF_JIT if !CPU_MICROMIPS
        select HAVE_FUNCTION_TRACER
        select HAVE_DYNAMIC_FTRACE
        select HAVE_FTRACE_MCOUNT_RECORD
index 7cd32c03828605c47f6a43949f3a246bcc4572d1..2fdb73d9198a0905f40ba06b543a86ec9ca6d9ec 100644 (file)
@@ -126,7 +126,7 @@ config PPC
        select IRQ_FORCED_THREADING
        select HAVE_RCU_TABLE_FREE if SMP
        select HAVE_SYSCALL_TRACEPOINTS
-       select HAVE_BPF_JIT
+       select HAVE_CBPF_JIT
        select HAVE_ARCH_JUMP_LABEL
        select ARCH_HAVE_NMI_SAFE_CMPXCHG
        select ARCH_HAS_GCOV_PROFILE_ALL
index bf24ab1889215abed3b8759dae2d45177ab960ab..a883981c0174a3ca3b14a7120166b920dc299504 100644 (file)
@@ -126,7 +126,7 @@ config S390
        select HAVE_ARCH_SOFT_DIRTY
        select HAVE_ARCH_TRACEHOOK
        select HAVE_ARCH_TRANSPARENT_HUGEPAGE
-       select HAVE_BPF_JIT if PACK_STACK && HAVE_MARCH_Z196_FEATURES
+       select HAVE_EBPF_JIT if PACK_STACK && HAVE_MARCH_Z196_FEATURES
        select HAVE_CMPXCHG_DOUBLE
        select HAVE_CMPXCHG_LOCAL
        select HAVE_DEBUG_KMEMLEAK
index 57ffaf285c2f511e1ee1549e8e002fa2f1e5d22c..d5003812c7485b3b35a2bfc53865bde047b1e38b 100644 (file)
@@ -32,7 +32,7 @@ config SPARC
        select ARCH_WANT_IPC_PARSE_VERSION
        select GENERIC_PCI_IOMAP
        select HAVE_NMI_WATCHDOG if SPARC64
-       select HAVE_BPF_JIT
+       select HAVE_CBPF_JIT
        select HAVE_DEBUG_BUGVERBOSE
        select GENERIC_SMP_IDLE_THREAD
        select GENERIC_CLOCKEVENTS
index 2dc18605831f6e88fd45c2863fc3d1fc7e6b6622..ae83046d51a8e08ab020b285c368390cc97a2003 100644 (file)
@@ -91,7 +91,7 @@ config X86
        select HAVE_ARCH_SOFT_DIRTY             if X86_64
        select HAVE_ARCH_TRACEHOOK
        select HAVE_ARCH_TRANSPARENT_HUGEPAGE
-       select HAVE_BPF_JIT                     if X86_64
+       select HAVE_EBPF_JIT                    if X86_64
        select HAVE_CC_STACKPROTECTOR
        select HAVE_CMPXCHG_DOUBLE
        select HAVE_CMPXCHG_LOCAL
index b841c42e5c9b7d38b0b62c9d6a31d0a61cc27409..f7148f24f11471696eee7d626352e02ea5b2f577 100644 (file)
@@ -289,7 +289,7 @@ config BQL
 
 config BPF_JIT
        bool "enable BPF Just In Time compiler"
-       depends on HAVE_BPF_JIT
+       depends on HAVE_CBPF_JIT || HAVE_EBPF_JIT
        depends on MODULES
        ---help---
          Berkeley Packet Filter filtering capabilities are normally handled
@@ -419,6 +419,14 @@ config MAY_USE_DEVLINK
 
 endif   # if NET
 
-# Used by archs to tell that they support BPF_JIT
-config HAVE_BPF_JIT
+# Used by archs to tell that they support BPF JIT compiler plus which flavour.
+# Only one of the two can be selected for a specific arch since eBPF JIT supersedes
+# the cBPF JIT.
+
+# Classic BPF JIT (cBPF)
+config HAVE_CBPF_JIT
+       bool
+
+# Extended BPF JIT (eBPF)
+config HAVE_EBPF_JIT
        bool