All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ilya Leoshkevich <iii@linux.ibm.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>,
	dwarves@vger.kernel.org, bpf@vger.kernel.org,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>, Yonghong Song <yhs@fb.com>,
	Heiko Carstens <hca@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>
Subject: Re: [PATCH dwarves v2] btf: Add support for the floating-point types
Date: Tue, 09 Mar 2021 14:06:54 +0100	[thread overview]
Message-ID: <689856c423b1075bdd4b35dce2bb0dd58d92cb1d.camel@linux.ibm.com> (raw)
In-Reply-To: <YEdglMDZvplD6ELk@kernel.org>

On Tue, 2021-03-09 at 08:48 -0300, Arnaldo Carvalho de Melo wrote:
> Em Tue, Mar 09, 2021 at 12:59:13AM +0100, Ilya Leoshkevich escreveu:
> > 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 libbpf compatibility level 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 and base_type.float_type
> > is
> >   set.
> > 
> > - 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} --libbpf_compat=0.4.0
> 
> I'm testing it now, and added as a followup patch the man page entry,
> please check that the wording is appropriate.
> 
> Thanks,
> 
> - Arnaldo
> 
> [acme@five pahole]$ vim man-pages/pahole.1
> [acme@five pahole]$ git diff
> diff --git a/man-pages/pahole.1 b/man-pages/pahole.1
> index 352bb5e45f319da4..787771753d1933b1 100644
> --- a/man-pages/pahole.1
> +++ b/man-pages/pahole.1
> @@ -199,6 +199,12 @@ Path to the base BTF file, for instance: vmlinux
> when encoding kernel module BTF
>  This may be inferred when asking for a /sys/kernel/btf/MODULE, when
> it will be autoconfigured
>  to "/sys/kernel/btf/vmlinux".
> 
> +.TP
> +.B \-\-libbpf_compat=LIBBPF_VERSION
> +Produce output compatible with this libbpf version. For instance,
> specifying 0.4.0 as
> +the version would encode BTF_KIND_FLOAT entries in systems where the
> vmlinux DWARF
> +information has float types.
> +
>  .TP
>  .B \-l, \-\-show_first_biggest_size_base_type_member
>  Show first biggest size base_type member.
> [acme@five pahole]$

The wording matches what I had in mind for this new flag, thanks!


  reply	other threads:[~2021-03-09 13:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-08 23:59 [PATCH dwarves v2] btf: Add support for the floating-point types Ilya Leoshkevich
2021-03-09 11:48 ` Arnaldo Carvalho de Melo
2021-03-09 13:06   ` Ilya Leoshkevich [this message]
2021-03-09 21:37   ` Andrii Nakryiko
2021-03-09 21:57     ` Ilya Leoshkevich
2021-03-10  4:14       ` Andrii Nakryiko
2021-03-10 13:37         ` Arnaldo Carvalho de Melo
2021-03-10 13:39           ` Ilya Leoshkevich

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=689856c423b1075bdd4b35dce2bb0dd58d92cb1d.camel@linux.ibm.com \
    --to=iii@linux.ibm.com \
    --cc=acme@kernel.org \
    --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=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.