All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ilya Leoshkevich <iii@linux.ibm.com>
To: Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>, Yonghong Song <yhs@fb.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	John Fastabend <john.fastabend@gmail.com>
Cc: bpf@vger.kernel.org, Heiko Carstens <heiko.carstens@de.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>
Subject: Re: [PATCH v3 bpf-next 4/6] bpf: Add BTF_KIND_FLOAT support
Date: Sun, 21 Feb 2021 17:37:59 +0100	[thread overview]
Message-ID: <77c3c64117e266c92fd43860afff858e92d07b6f.camel@linux.ibm.com> (raw)
In-Reply-To: <20210220034959.27006-5-iii@linux.ibm.com>

On Sat, 2021-02-20 at 04:49 +0100, Ilya Leoshkevich wrote:
> On the kernel side, introduce a new btf_kind_operations. It is
> similar to that of BTF_KIND_INT, however, it does not need to
> handle encodings and bit offsets. Do not implement printing, since
> the kernel does not know how to format floating-point values.
> 
> Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
> ---
>  kernel/bpf/btf.c | 77
> ++++++++++++++++++++++++++++++++++++++++++++++--
>  1 file changed, 75 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c
> index 2efeb5f4b343..813c2bfe284f 100644
> --- a/kernel/bpf/btf.c
> +++ b/kernel/bpf/btf.c

[...]

> +static int btf_float_check_member(struct btf_verifier_env *env,
> +                                 const struct btf_type *struct_type,
> +                                 const struct btf_member *member,
> +                                 const struct btf_type *member_type)
> +{
> +       u64 start_offset_bytes;
> +       u64 end_offset_bytes;
> +       u64 align_bytes;
> +       u64 align_bits;
> +
> +       align_bytes = min_t(u64, sizeof(void *), member_type->size);
> +       align_bits = align_bytes * BITS_PER_BYTE;
> +       if (member->offset % align_bits) {

The kernel test robot's link error is most likely due to this line.
I should be using do_div here.

[...]



  parent reply	other threads:[~2021-02-21 16:40 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-20  3:49 [PATCH v3 bpf-next 0/6] Add BTF_KIND_FLOAT support Ilya Leoshkevich
2021-02-20  3:49 ` [PATCH v3 bpf-next 1/6] bpf: Add BTF_KIND_FLOAT to uapi Ilya Leoshkevich
2021-02-22  3:42   ` Yonghong Song
2021-02-20  3:49 ` [PATCH v3 bpf-next 2/6] libbpf: Add BTF_KIND_FLOAT support Ilya Leoshkevich
2021-02-22  3:41   ` Yonghong Song
2021-02-20  3:49 ` [PATCH v3 bpf-next 3/6] tools/bpftool: " Ilya Leoshkevich
2021-02-22  3:44   ` Yonghong Song
2021-02-20  3:49 ` [PATCH v3 bpf-next 4/6] bpf: " Ilya Leoshkevich
2021-02-20  6:13   ` kernel test robot
2021-02-20  6:13     ` kernel test robot
2021-02-20  6:24   ` kernel test robot
2021-02-20  6:24     ` kernel test robot
2021-02-21 16:37   ` Ilya Leoshkevich [this message]
2021-02-20  3:49 ` [PATCH v3 bpf-next 5/6] selftest/bpf: Add BTF_KIND_FLOAT tests Ilya Leoshkevich
2021-02-22  3:53   ` Yonghong Song
2021-02-20  3:49 ` [PATCH v3 bpf-next 6/6] bpf: Document BTF_KIND_FLOAT in btf.rst Ilya Leoshkevich
2021-02-22  3:55   ` Yonghong Song

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=77c3c64117e266c92fd43860afff858e92d07b6f.camel@linux.ibm.com \
    --to=iii@linux.ibm.com \
    --cc=acme@redhat.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=gor@linux.ibm.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=john.fastabend@gmail.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.