From: "Edgecombe, Rick P" <rick.p.edgecombe@intel.com>
To: "daniel@iogearbox.net" <daniel@iogearbox.net>, "ast@fb.com" <ast@fb.com>
Cc: "kristen@linux.intel.com" <kristen@linux.intel.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"ard.biesheuvel@linaro.org" <ard.biesheuvel@linaro.org>,
"Hansen, Dave" <dave.hansen@intel.com>
Subject: Re: [RFC PATCH 0/4] Initial support for allocating BPF JITs in vmalloc for x86
Date: Wed, 6 Feb 2019 01:11:44 +0000 [thread overview]
Message-ID: <e3697ab2717d9440da72775a25b83d6193a42ea2.camel@intel.com> (raw)
In-Reply-To: <84060613-48b1-fa62-e784-104faa7fc665@fb.com>
On Wed, 2019-02-06 at 00:35 +0000, Alexei Starovoitov wrote:
> On 2/5/19 2:50 PM, Rick Edgecombe wrote:
> > This introduces a new capability for BPF program JIT's to be located in
> > vmalloc
> > space on x86_64. This can serve as a backup area for
> > CONFIG_BPF_JIT_ALWAYS_ON in
> > case an unprivileged app uses all of the module space allowed by
> > bpf_jit_limit.
> >
> > In order to allow for calls from the increased distance of vmalloc from
> > kernel/module space, relative calls are emitted as full indirect calls if
> > the
> > maximum relative call distance is exceeded. So the resulting performance of
> > call
> > BPF instructions in this case is similar to the BPF interpreter.
>
> If I read this correctly the patches introduce retpoline overhead
> to direct function call because JITed progs are more than 32-bit apart
> and they're far away only because of dubious security concern ?
> Nack.
>
There really isn't any overhead, because they are only far away if the module
space is full, or the bpf_jit_limit is exceeded for non-admin. So cases today
when insertions would succeed it emits the same code, but cases where the
insertion would fail due to lack of space, it now at least works with the
described performance.
next prev parent reply other threads:[~2019-02-06 1:11 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-05 22:50 [RFC PATCH 0/4] Initial support for allocating BPF JITs in vmalloc for x86 Rick Edgecombe
2019-02-05 22:51 ` [RFC PATCH 1/4] bpf, x64: Implement BPF call retpoline Rick Edgecombe
2019-02-05 22:51 ` [RFC PATCH 2/4] bpf, x64: Increase distance for bpf calls Rick Edgecombe
2019-02-05 22:51 ` [RFC PATCH 3/4] bpf: Charge bpf jit limit in bpf_jit_alloc_exec Rick Edgecombe
2019-02-05 22:51 ` [RFC PATCH 4/4] bpf, x64: Enable unprivlidged jit in vmalloc Rick Edgecombe
2019-02-06 0:35 ` [RFC PATCH 0/4] Initial support for allocating BPF JITs in vmalloc for x86 Alexei Starovoitov
2019-02-06 1:11 ` Edgecombe, Rick P [this message]
2019-02-06 1:40 ` Alexei Starovoitov
2019-02-06 15:38 ` Daniel Borkmann
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=e3697ab2717d9440da72775a25b83d6193a42ea2.camel@intel.com \
--to=rick.p.edgecombe@intel.com \
--cc=ard.biesheuvel@linaro.org \
--cc=ast@fb.com \
--cc=daniel@iogearbox.net \
--cc=dave.hansen@intel.com \
--cc=kristen@linux.intel.com \
--cc=netdev@vger.kernel.org \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox