All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eduard Zingerman <eddyz87@gmail.com>
To: Alan Maguire <alan.maguire@oracle.com>
Cc: ast@kernel.org,  andrii@kernel.org,  daniel@iogearbox.net,
	martin.lau@linux.dev,  song@kernel.org,  yonghong.song@linux.dev,
	john.fastabend@gmail.com,  kpsingh@kernel.org,  sdf@fomichev.me,
	haoluo@google.com,  jolsa@kernel.org,  mykolal@fb.com,
	bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next] selftests/bpf: add btf dedup test covering module BTF dedup
Date: Wed, 30 Apr 2025 14:30:19 -0700	[thread overview]
Message-ID: <m2y0vhfic4.fsf@gmail.com> (raw)
In-Reply-To: <20250430134249.2451066-1-alan.maguire@oracle.com> (Alan Maguire's message of "Wed, 30 Apr 2025 14:42:49 +0100")

Alan Maguire <alan.maguire@oracle.com> writes:

> Recently issues were observed with module BTF deduplication failures
> [1].  Add a dedup selftest that ensures that core kernel types are
> referenced from split BTF as base BTF types.  To do this use bpf_testmod
> functions which utilize core kernel types, specifically
>
> ssize_t
> bpf_testmod_test_write(struct file *file, struct kobject *kobj,
>                        struct bin_attribute *bin_attr,
>                        char *buf, loff_t off, size_t len);
>
> __bpf_kfunc struct sock *bpf_kfunc_call_test3(struct sock *sk);
>
> __bpf_kfunc void bpf_kfunc_call_test_pass_ctx(struct __sk_buff *skb);
>
> For each of these ensure that the types they reference -
> struct file, struct kobject, struct bin_attr etc - are in base BTF.
> Note that because bpf_testmod.ko is built with distilled base BTF
> the associated reference types - i.e. the PTR that points at a
> "struct file" - will be in split BTF.  As a result the test resolves
> typedef and pointer references and verifies the pointed-at or
> typedef'ed type is in base BTF.  Because we use BTF from
> /sys/kernel/btf/bpf_testmod relocation has occurred for the
> referenced types and they will be base - not distilled base - types.
>
> For large-scale dedup issues, we see such types appear in split BTF and
> as a result this test fails.  Hence it is proposed as a test which will
> fail when large-scale dedup issues have occurred.
>
> [1] https://lore.kernel.org/dwarves/CAADnVQL+-LiJGXwxD3jEUrOonO-fX0SZC8496dVzUXvfkB7gYQ@mail.gmail.com/
>
> Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
> ---

The test passes for LLVM and fails for gcc 14, when using pahole w/o
fixes discussed in [1].

Acked-by: Eduard Zingerman <eddyz87@gmail.com>

  reply	other threads:[~2025-04-30 21:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-30 13:42 [PATCH bpf-next] selftests/bpf: add btf dedup test covering module BTF dedup Alan Maguire
2025-04-30 21:30 ` Eduard Zingerman [this message]
2025-05-01 21:10 ` patchwork-bot+netdevbpf
2025-06-20 13:34 ` Jiri Olsa
2025-06-20 13:51   ` Jiri Olsa
2025-06-20 15:41     ` Alan Maguire
2025-06-24 11:48       ` Jiri Olsa

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=m2y0vhfic4.fsf@gmail.com \
    --to=eddyz87@gmail.com \
    --cc=alan.maguire@oracle.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=haoluo@google.com \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=mykolal@fb.com \
    --cc=sdf@fomichev.me \
    --cc=song@kernel.org \
    --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 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.