From: Daniel Borkmann <daniel@iogearbox.net>
To: Yonghong Song <yhs@fb.com>, Andrii Nakryiko <andriin@fb.com>,
"bpf@vger.kernel.org" <bpf@vger.kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
Alexei Starovoitov <ast@fb.com>
Cc: "andrii.nakryiko@gmail.com" <andrii.nakryiko@gmail.com>,
Kernel Team <Kernel-team@fb.com>
Subject: Re: [PATCH v2 bpf-next] libbpf: support CO-RE relocations for LDX/ST/STX instructions
Date: Thu, 26 Dec 2019 10:44:18 +0100 [thread overview]
Message-ID: <a083506e-12e3-e39b-086f-fd03f2cf367e@iogearbox.net> (raw)
In-Reply-To: <c8e07d16-9b7e-5847-b8a8-853f4aaf620f@fb.com>
On 12/23/19 7:10 PM, Yonghong Song wrote:
> On 12/23/19 10:03 AM, Andrii Nakryiko wrote:
>> Clang patch [0] enables emitting relocatable generic ALU/ALU64 instructions
>> (i.e, shifts and arithmetic operations), as well as generic load/store
>> instructions. The former ones are already supported by libbpf as is. This
>> patch adds further support for load/store instructions. Relocatable field
>> offset is encoded in BPF instruction's 16-bit offset section and are adjusted
>> by libbpf based on target kernel BTF.
>>
>> These Clang changes and corresponding libbpf changes allow for more succinct
>> generated BPF code by encoding relocatable field reads as a single
>> ST/LDX/STX instruction. It also enables relocatable access to BPF context.
>> Previously, if context struct (e.g., __sk_buff) was accessed with CO-RE
>> relocations (e.g., due to preserve_access_index attribute), it would be
>> rejected by BPF verifier due to modified context pointer dereference. With
>> Clang patch, such context accesses are both relocatable and have a fixed
>> offset from the point of view of BPF verifier.
>>
>> [0] https://reviews.llvm.org/D71790
>>
>> Signed-off-by: Andrii Nakryiko <andriin@fb.com>
> Acked-by: Yonghong Song <yhs@fb.com>
Applied, thanks!
prev parent reply other threads:[~2019-12-26 9:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-23 18:03 [PATCH v2 bpf-next] libbpf: support CO-RE relocations for LDX/ST/STX instructions Andrii Nakryiko
2019-12-23 18:10 ` Yonghong Song
2019-12-26 9:44 ` Daniel Borkmann [this message]
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=a083506e-12e3-e39b-086f-fd03f2cf367e@iogearbox.net \
--to=daniel@iogearbox.net \
--cc=Kernel-team@fb.com \
--cc=andrii.nakryiko@gmail.com \
--cc=andriin@fb.com \
--cc=ast@fb.com \
--cc=bpf@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--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
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