From: Alexander Lobakin <firstname.lastname@example.org> To: Paul Burton <email@example.com> Cc: Paul Burton <firstname.lastname@example.org>, Hassan Naveed <email@example.com>, Ralf Baechle <firstname.lastname@example.org>, James Hogan <email@example.com>, Alexei Starovoitov <firstname.lastname@example.org>, Daniel Borkmann <email@example.com>, Martin KaFai Lau <firstname.lastname@example.org>, Song Liu <email@example.com>, Yonghong Song <firstname.lastname@example.org>, Andrii Nakryiko <email@example.com>, firstname.lastname@example.org, email@example.com, firstname.lastname@example.org, email@example.com Subject: Re: MIPS eBPF JIT support on pre-32R2 Date: Fri, 06 Dec 2019 10:20:40 +0300 [thread overview] Message-ID: <firstname.lastname@example.org> (raw) In-Reply-To: <email@example.com> Paul Burton wrote 05.12.2019 21:44: > Hi Alexander, Hi Paul! > On Thu, Dec 05, 2019 at 03:45:27PM +0300, Alexander Lobakin wrote: >> 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? > > No, they don't; the eBPF JIT makes unconditional use of at least the > (d)ins & (d)ext instructions which were added in MIPSr2, so it would > result in reserved instruction exceptions & panics if enabled on > pre-MIPSr2 CPUs. > >> 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) > > Good spot; I agree entirely, this dependency should be reflected in > Kconfig. > >> 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). > > That would be great, thanks! Great, I'll send it in about ~2-3 hours. > One thing to note is that I hope we'll restore the cBPF JIT with this > patch: > > https://firstname.lastname@example.org/T/#u > > The cBPF JIT looks like it should work on older pre-MIPSr2 CPUs, so the > only way this is relevant is that your patch might have a minor > conflict. But I thought I'd mention it anyway :) Yes, I thought about this too. If pre-32R2 CPUs don't support our eBPF JIT, we'd better restore cBPF for them, so they could speed-up at least "classic" instructions. Glad you've decided to do that. > Thanks, > Paul Regards, ᚷ ᛖ ᚢ ᚦ ᚠ ᚱ
next prev parent reply other threads:[~2019-12-06 7:20 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-12-05 12:45 Alexander Lobakin 2019-12-05 13:04 ` Daniel Borkmann 2019-12-05 18:44 ` Paul Burton 2019-12-06 7:20 ` Alexander Lobakin [this message] 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 \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --subject='Re: MIPS eBPF JIT support on pre-32R2' \ /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
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).