netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf] riscv: remove BPF JIT for nommu builds
@ 2020-03-31 10:10 Björn Töpel
  2020-03-31 14:57 ` Luke Nelson
  2020-04-02 22:51 ` Daniel Borkmann
  0 siblings, 2 replies; 3+ messages in thread
From: Björn Töpel @ 2020-03-31 10:10 UTC (permalink / raw)
  To: netdev, bpf, ast, daniel
  Cc: Björn Töpel, linux-riscv, Damien.LeMoal, hch,
	kbuild test robot

The BPF JIT fails to build for kernels configured to !MMU. Without an
MMU, the BPF JIT does not make much sense, therefore this patch
disables the JIT for nommu builds.

This was reported by the kbuild test robot:

   All errors (new ones prefixed by >>):

      arch/riscv/net/bpf_jit_comp64.c: In function 'bpf_jit_alloc_exec':
   >> arch/riscv/net/bpf_jit_comp64.c:1094:47: error: 'BPF_JIT_REGION_START' undeclared (first use in this function)
       1094 |  return __vmalloc_node_range(size, PAGE_SIZE, BPF_JIT_REGION_START,
            |                                               ^~~~~~~~~~~~~~~~~~~~
      arch/riscv/net/bpf_jit_comp64.c:1094:47: note: each undeclared identifier is reported only once for each function it appears in
   >> arch/riscv/net/bpf_jit_comp64.c:1095:9: error: 'BPF_JIT_REGION_END' undeclared (first use in this function)
       1095 |         BPF_JIT_REGION_END, GFP_KERNEL,
            |         ^~~~~~~~~~~~~~~~~~
      arch/riscv/net/bpf_jit_comp64.c:1098:1: warning: control reaches end of non-void function [-Wreturn-type]
       1098 | }
            | ^

Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Björn Töpel <bjorn.topel@gmail.com>
---
 arch/riscv/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index 8672e77a5b7a..bd35ac72fe24 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -55,7 +55,7 @@ config RISCV
 	select ARCH_HAS_PTE_SPECIAL
 	select ARCH_HAS_MMIOWB
 	select ARCH_HAS_DEBUG_VIRTUAL
-	select HAVE_EBPF_JIT
+	select HAVE_EBPF_JIT if MMU
 	select EDAC_SUPPORT
 	select ARCH_HAS_GIGANTIC_PAGE
 	select ARCH_WANT_HUGE_PMD_SHARE if 64BIT
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH bpf] riscv: remove BPF JIT for nommu builds
  2020-03-31 10:10 [PATCH bpf] riscv: remove BPF JIT for nommu builds Björn Töpel
@ 2020-03-31 14:57 ` Luke Nelson
  2020-04-02 22:51 ` Daniel Borkmann
  1 sibling, 0 replies; 3+ messages in thread
From: Luke Nelson @ 2020-03-31 14:57 UTC (permalink / raw)
  To: Björn Töpel
  Cc: Netdev, bpf, Alexei Starovoitov, Daniel Borkmann, linux-riscv,
	Damien.LeMoal, hch, kbuild test robot

Thanks for looking into this!

Acked-by: Luke Nelson <luke.r.nels@gmail.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH bpf] riscv: remove BPF JIT for nommu builds
  2020-03-31 10:10 [PATCH bpf] riscv: remove BPF JIT for nommu builds Björn Töpel
  2020-03-31 14:57 ` Luke Nelson
@ 2020-04-02 22:51 ` Daniel Borkmann
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Borkmann @ 2020-04-02 22:51 UTC (permalink / raw)
  To: Björn Töpel, netdev, bpf, ast
  Cc: linux-riscv, Damien.LeMoal, hch, kbuild test robot

On 3/31/20 12:10 PM, Björn Töpel wrote:
> The BPF JIT fails to build for kernels configured to !MMU. Without an
> MMU, the BPF JIT does not make much sense, therefore this patch
> disables the JIT for nommu builds.
> 
> This was reported by the kbuild test robot:
> 
>     All errors (new ones prefixed by >>):
> 
>        arch/riscv/net/bpf_jit_comp64.c: In function 'bpf_jit_alloc_exec':
>     >> arch/riscv/net/bpf_jit_comp64.c:1094:47: error: 'BPF_JIT_REGION_START' undeclared (first use in this function)
>         1094 |  return __vmalloc_node_range(size, PAGE_SIZE, BPF_JIT_REGION_START,
>              |                                               ^~~~~~~~~~~~~~~~~~~~
>        arch/riscv/net/bpf_jit_comp64.c:1094:47: note: each undeclared identifier is reported only once for each function it appears in
>     >> arch/riscv/net/bpf_jit_comp64.c:1095:9: error: 'BPF_JIT_REGION_END' undeclared (first use in this function)
>         1095 |         BPF_JIT_REGION_END, GFP_KERNEL,
>              |         ^~~~~~~~~~~~~~~~~~
>        arch/riscv/net/bpf_jit_comp64.c:1098:1: warning: control reaches end of non-void function [-Wreturn-type]
>         1098 | }
>              | ^
> 
> Reported-by: kbuild test robot <lkp@intel.com>
> Signed-off-by: Björn Töpel <bjorn.topel@gmail.com>

Applied, thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-04-02 22:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-31 10:10 [PATCH bpf] riscv: remove BPF JIT for nommu builds Björn Töpel
2020-03-31 14:57 ` Luke Nelson
2020-04-02 22:51 ` Daniel Borkmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).