Linux-MIPS Archive on lore.kernel.org
 help / color / Atom feed
From: Alexander Lobakin <alobakin@dlink.ru>
To: Paul Burton <paul.burton@mips.com>
Cc: Hassan Naveed <hnaveed@wavecomp.com>,
	Ralf Baechle <ralf@linux-mips.org>,
	James Hogan <jhogan@kernel.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Martin KaFai Lau <kafai@fb.com>, Song Liu <songliubraving@fb.com>,
	Yonghong Song <yhs@fb.com>, Andrii Nakryiko <andriin@fb.com>,
	netdev@vger.kernel.org, bpf@vger.kernel.org,
	linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: MIPS eBPF JIT support on pre-32R2
Date: Thu, 05 Dec 2019 15:45:27 +0300
Message-ID: <09d713a59665d745e21d021deeaebe0a@dlink.ru> (raw)

Hey all,

I'm writing about lines arch/mips/net/ebpf_jit.c:1806-1807:

	if (!prog->jit_requested || MIPS_ISA_REV < 2)
		return prog;

Do pre-32R2 architectures (32R1, maybe even R3000-like) actually support
this eBPF JIT code? If they do, then the condition 'MIPS_ISA_REV < 2'
should be removed as it is always true for them and tells CC to remove
JIT completely.

If they don't support instructions from this JIT, then the line
arch/mips/Kconfig:50:

	select HAVE_EBPF_JIT if (!CPU_MICROMIPS)

should be changed to something like:

	select HAVE_EBPF_JIT if !CPU_MICROMIPS && TARGET_ISA_REV >= 2

(and then the mentioned 'if' condition would become redundant)

At the moment it is possible to build a kernel without both JIT and
interpreter, but with CONFIG_BPF_SYSCALL=y (what should not be allowed
I suppose?) within the following configuration:

- select any pre-32R2 CPU (e.g. CONFIG_CPU_MIPS32_R1);
- enable CONFIG_BPF_JIT (CONFIG_MIPS_EBPF_JIT will be autoselected);
- enable CONFIG_BPF_JIT_ALWAYS_ON (this removes BPF interpreter from
   the system).

I may prepare a proper patch by myself if needed (after clarification).
Thanks.

Regards,
ᚷ ᛖ ᚢ ᚦ ᚠ ᚱ

             reply index

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-05 12:45 Alexander Lobakin [this message]
2019-12-05 13:04 ` Daniel Borkmann
2019-12-05 18:44 ` Paul Burton
2019-12-06  7:20   ` Alexander Lobakin
2019-12-06  8:11     ` Alexander Lobakin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=09d713a59665d745e21d021deeaebe0a@dlink.ru \
    --to=alobakin@dlink.ru \
    --cc=andriin@fb.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=hnaveed@wavecomp.com \
    --cc=jhogan@kernel.org \
    --cc=kafai@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=paul.burton@mips.com \
    --cc=ralf@linux-mips.org \
    --cc=songliubraving@fb.com \
    --cc=yhs@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-MIPS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-mips/0 linux-mips/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mips linux-mips/ https://lore.kernel.org/linux-mips \
		linux-mips@vger.kernel.org
	public-inbox-index linux-mips

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-mips


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git