bpf: get rid of pure_initcall dependency to enable jits
authorDaniel Borkmann <daniel@iogearbox.net>
Sat, 20 Jan 2018 00:24:33 +0000 (01:24 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Sat, 20 Jan 2018 02:37:00 +0000 (18:37 -0800)
commitfa9dd599b4dae841924b022768354cfde9affecb
tree9f26c547aa46c73afa8ad85cc63ef9931fb86821
parent87c1793b1b7f34915e9e64cdb503efb281c769a7
bpf: get rid of pure_initcall dependency to enable jits

Having a pure_initcall() callback just to permanently enable BPF
JITs under CONFIG_BPF_JIT_ALWAYS_ON is unnecessary and could leave
a small race window in future where JIT is still disabled on boot.
Since we know about the setting at compilation time anyway, just
initialize it properly there. Also consolidate all the individual
bpf_jit_enable variables into a single one and move them under one
location. Moreover, don't allow for setting unspecified garbage
values on them.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
13 files changed:
arch/arm/net/bpf_jit_32.c
arch/arm64/net/bpf_jit_comp.c
arch/mips/net/bpf_jit.c
arch/mips/net/ebpf_jit.c
arch/powerpc/net/bpf_jit_comp.c
arch/powerpc/net/bpf_jit_comp64.c
arch/s390/net/bpf_jit_comp.c
arch/sparc/net/bpf_jit_comp_32.c
arch/sparc/net/bpf_jit_comp_64.c
arch/x86/net/bpf_jit_comp.c
kernel/bpf/core.c
net/core/sysctl_net_core.c
net/socket.c