From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: Eduard Zingerman <eddyz87@gmail.com>,
dwarves@vger.kernel.org, arnaldo.melo@gmail.com,
bpf@vger.kernel.org, kernel-team@fb.com, ast@kernel.org,
daniel@iogearbox.net, andrii@kernel.org, yonghong.song@linux.dev,
martin.lau@linux.dev
Subject: Re: [PATCH dwarves v1] pahole: generate "bpf_fastcall" decl tags for eligible kfuncs
Date: Mon, 30 Sep 2024 11:44:30 -0300 [thread overview]
Message-ID: <Zvq5TmDGqZIdPMya@x1> (raw)
In-Reply-To: <CAEf4BzY5qmrRjNHESAjNm9DnMdfqmaHWYFXZZUC=L0pLJMLuwA@mail.gmail.com>
On Fri, Sep 27, 2024 at 02:52:24PM -0700, Andrii Nakryiko wrote:
> On Mon, Sep 16, 2024 at 2:19 AM Eduard Zingerman <eddyz87@gmail.com> wrote:
> >
> > For kfuncs marked with KF_FASTCALL flag generate the following pair of
> > decl tags:
> >
> > $ bpftool btf dump file vmlinux
> > ...
> > [A] FUNC 'bpf_rdonly_cast' type_id=...
> > ...
> > [B] DECL_TAG 'bpf_kfunc' type_id=A component_idx=-1
> > [C] DECL_TAG 'bpf_fastcall' type_id=A component_idx=-1
> >
> > So that bpftool could find 'bpf_fastcall' decl tag and generate
> > appropriate C declarations for such kfuncs, e.g.:
> >
> > #ifndef __VMLINUX_H__
> > #define __VMLINUX_H__
> > ...
> > #define __bpf_fastcall __attribute__((bpf_fastcall))
> > ...
> > __bpf_fastcall extern void *bpf_rdonly_cast(...) ...;
> >
> > For additional information about 'bpf_fastcall' attribute,
> > see the following commit in the LLVM source tree:
> >
> > 64e464349bfc ("[BPF] introduce __attribute__((bpf_fastcall))")
> >
> > And the following Linux kernel commit:
> >
> > 52839f31cece ("Merge branch 'no_caller_saved_registers-attribute-for-helper-calls'")
> >
> > Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
> > ---
> > btf_encoder.c | 59 +++++++++++++++++++++++++++++++++++++--------------
> > 1 file changed, 43 insertions(+), 16 deletions(-)
> >
>
> LGTM,
>
> Acked-by: Andrii Nakryiko <andrii@kernel.org>
>
> Arnaldo, can you please take a look and if everything seems sane apply
> it to pahole master, so it's easier to use it locally? Thanks!
Minor clash with Alan's
Fixes: 5205d02d8e84a775 ("btf_encoder: record BTF-centric function state instead of DWARF-centric")
Fixed up, testing.
- Arnaldo
next prev parent reply other threads:[~2024-09-30 14:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-16 9:19 [PATCH dwarves v1] pahole: generate "bpf_fastcall" decl tags for eligible kfuncs Eduard Zingerman
2024-09-16 9:24 ` Eduard Zingerman
2024-09-16 10:16 ` Alan Maguire
2024-09-17 4:40 ` Eduard Zingerman
2024-09-17 8:21 ` Alan Maguire
2024-09-27 21:52 ` Andrii Nakryiko
2024-09-30 14:44 ` Arnaldo Carvalho de Melo [this message]
2024-12-09 19:30 ` Arnaldo Carvalho de Melo
2024-12-09 20:05 ` Eduard Zingerman
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=Zvq5TmDGqZIdPMya@x1 \
--to=acme@kernel.org \
--cc=andrii.nakryiko@gmail.com \
--cc=andrii@kernel.org \
--cc=arnaldo.melo@gmail.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=dwarves@vger.kernel.org \
--cc=eddyz87@gmail.com \
--cc=kernel-team@fb.com \
--cc=martin.lau@linux.dev \
--cc=yonghong.song@linux.dev \
/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