[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAEf4BzbEPEFEzdShpPgPyA=aYj5UJwbC=Dod=yrcqWAzPUuqgg@mail.gmail.com>
Date: Fri, 11 Feb 2022 16:42:20 -0800
From: Andrii Nakryiko <andrii.nakryiko@...il.com>
To: Mauricio Vásquez <mauricio@...volk.io>
Cc: Networking <netdev@...r.kernel.org>, bpf <bpf@...r.kernel.org>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Andrii Nakryiko <andrii@...nel.org>,
Quentin Monnet <quentin@...valent.com>,
Rafael David Tinoco <rafaeldtinoco@...il.com>,
Lorenzo Fontana <lorenzo.fontana@...stic.co>,
Leonardo Di Donato <leonardo.didonato@...stic.co>
Subject: Re: [PATCH bpf-next v6 1/7] libbpf: split bpf_core_apply_relo()
On Wed, Feb 9, 2022 at 2:27 PM Mauricio Vásquez <mauricio@...volk.io> wrote:
>
> BTFGen needs to run the core relocation logic in order to understand
> what are the types involved in a given relocation.
>
> Currently bpf_core_apply_relo() calculates and **applies** a relocation
> to an instruction. Having both operations in the same function makes it
> difficult to only calculate the relocation without patching the
> instruction. This commit splits that logic in two different phases: (1)
> calculate the relocation and (2) patch the instruction.
>
> For the first phase bpf_core_apply_relo() is renamed to
> bpf_core_calc_relo_insn() who is now only on charge of calculating the
> relocation, the second phase uses the already existing
> bpf_core_patch_insn(). bpf_object__relocate_core() uses both of them and
> the BTFGen will use only bpf_core_calc_relo_insn().
>
> Signed-off-by: Mauricio Vásquez <mauricio@...volk.io>
> Signed-off-by: Rafael David Tinoco <rafael.tinoco@...asec.com>
> Signed-off-by: Lorenzo Fontana <lorenzo.fontana@...stic.co>
> Signed-off-by: Leonardo Di Donato <leonardo.didonato@...stic.co>
> ---
LGTM.
Acked-by: Andrii Nakryiko <andrii@...nel.org>
> kernel/bpf/btf.c | 13 +++++--
> tools/lib/bpf/libbpf.c | 71 ++++++++++++++++++++---------------
> tools/lib/bpf/relo_core.c | 79 ++++++++++++---------------------------
> tools/lib/bpf/relo_core.h | 42 ++++++++++++++++++---
> 4 files changed, 109 insertions(+), 96 deletions(-)
>
[...]
Powered by blists - more mailing lists