dwarves.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrii Nakryiko <andrii.nakryiko@gmail.com>
To: Ilya Leoshkevich <iii@linux.ibm.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>,
	Andrii Nakryiko <andrii@kernel.org>,
	dwarves@vger.kernel.org, bpf <bpf@vger.kernel.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Yonghong Song <yhs@fb.com>, Heiko Carstens <hca@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>
Subject: Re: [PATCH v4 dwarves] btf: Add support for the floating-point types
Date: Wed, 10 Mar 2021 13:35:39 -0800	[thread overview]
Message-ID: <CAEf4Bzbyugfb2RkBkRuxNGKwSk40Tbq4zAvhQT8W=fVMYWuaxA@mail.gmail.com> (raw)
In-Reply-To: <ff68a62e776ce9e459bece7ae87cc53573500a50.camel@linux.ibm.com>

On Wed, Mar 10, 2021 at 1:02 PM Ilya Leoshkevich <iii@linux.ibm.com> wrote:
>
> On Wed, 2021-03-10 at 12:25 -0800, Andrii Nakryiko wrote:
> > On Wed, Mar 10, 2021 at 12:16 PM Ilya Leoshkevich <iii@linux.ibm.com>
> > wrote:
> > >
> > > Some BPF programs compiled on s390 fail to load, because s390
> > > arch-specific linux headers contain float and double types.
> > >
> > > Fix as follows:
> > >
> > > - Make the DWARF loader fill base_type.float_type.
> > >
> > > - Introduce the --btf_gen_floats command-line parameter, so that
> > >   pahole could be used to build both the older and the newer
> > > kernels.
> > >
> > > - libbpf introduced the support for the floating-point types in
> > > commit
> > >   986962fade5, so update the libbpf submodule to that version and
> > > use
> > >   the new btf__add_float() function in order to emit the floating-
> > > point
> > >   types when not in the compatibility mode.
> > >
> > > - Make the BTF loader recognize the new BTF kind.
> > >
> > > Example of the resulting entry in the vmlinux BTF:
> > >
> > >     [7164] FLOAT 'double' size=8
> > >
> > > when building with:
> > >
> > >     LLVM_OBJCOPY=${OBJCOPY} ${PAHOLE} -J ${1} --btf_gen_floats
> > >
> > > Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
> > > ---
> >
> > So it looks good to me overall, but here's the question about using
> > this --btf-gen-floats flag from link-vmlinux.sh script. If you
> > specify
> > that flag for an old pahole, it will probably error out, right? So
> > that means we'll need to do feature detection for pahole supported
> > features, right?..
>
> I was planning to just bump the version in this check:
>
>     if [ "${pahole_ver}" -lt "116" ]; then

No-no-no, we can't just arbitrarily say that the minimal pahole
version is now 1.21, while 1.16 would work just fine in almost all
cases on almost all architectures.

>
> But we could also keep allowing 1.16-1.20 and pass the new flag on
> 1.21+ only.
>
> What do you think?

I think we'll have to do the extra check. I'd also add something like
--btf-gen-all, that would turn on all the supported BTF features. So
that people that generate BTF for kernels externally (e.g., for old
kernels to support BPF CO-RE), could just do --btf-gen-all, instead of
potentially longer list of all the BTF optional subsets
(--btf-gen-floats --btf-gen-somemore --btf-gen-morecool etc). That
doesn't have to happen in this patch, of course.

So with what we have now:

Acked-by: Andrii Nakryiko <andrii@kernel.org>

>

  reply	other threads:[~2021-03-10 21:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-10 20:15 [PATCH v4 dwarves] btf: Add support for the floating-point types Ilya Leoshkevich
2021-03-10 20:25 ` Andrii Nakryiko
2021-03-10 21:02   ` Ilya Leoshkevich
2021-03-10 21:35     ` Andrii Nakryiko [this message]
2021-03-11 17:46       ` Arnaldo Carvalho de Melo

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='CAEf4Bzbyugfb2RkBkRuxNGKwSk40Tbq4zAvhQT8W=fVMYWuaxA@mail.gmail.com' \
    --to=andrii.nakryiko@gmail.com \
    --cc=acme@redhat.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=dwarves@vger.kernel.org \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=iii@linux.ibm.com \
    --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;
as well as URLs for NNTP newsgroup(s).