MIPS: BPF: eBPF JIT: check for MIPS ISA compliance in Kconfig
authorAlexander Lobakin <alobakin@dlink.ru>
Fri, 6 Dec 2019 08:07:41 +0000 (11:07 +0300)
committerPaul Burton <paulburton@kernel.org>
Wed, 18 Dec 2019 23:15:04 +0000 (15:15 -0800)
commitf596cf0d8062cb5d0a4513a8b3afca318c13be10
tree6f74bba6b347b6382056030705a1ebdc4a0de319
parentf8fffebdea752a25757b906f3dffecf1a59a6194
MIPS: BPF: eBPF JIT: check for MIPS ISA compliance in Kconfig

It is completely wrong to check for compile-time MIPS ISA revision in
the body of bpf_int_jit_compile() as it may lead to get MIPS JIT fully
omitted by the CC while the rest system will think that the JIT is
actually present and works [1].
We can check if the selected CPU really supports MIPS eBPF JIT at
configure time and avoid such situations when kernel can be built
without both JIT and interpreter, but with CONFIG_BPF_SYSCALL=y.

[1] https://lore.kernel.org/linux-mips/09d713a59665d745e21d021deeaebe0a@dlink.ru/

Fixes: 716850ab104d ("MIPS: eBPF: Initial eBPF support for MIPS32 architecture.")
Cc: <stable@vger.kernel.org> # v5.2+
Signed-off-by: Alexander Lobakin <alobakin@dlink.ru>
Signed-off-by: Paul Burton <paulburton@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: James Hogan <jhogan@kernel.org>
Cc: Hassan Naveed <hnaveed@wavecomp.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Martin KaFai Lau <kafai@fb.com>
Cc: Song Liu <songliubraving@fb.com>
Cc: Yonghong Song <yhs@fb.com>
Cc: Andrii Nakryiko <andriin@fb.com>
Cc: linux-mips@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: bpf@vger.kernel.org
arch/mips/Kconfig
arch/mips/net/ebpf_jit.c