From: Eduard Zingerman <eddyz87@gmail.com>
To: Jiri Olsa <olsajiri@gmail.com>
Cc: Tony Ambardar <tony.ambardar@gmail.com>,
bpf@vger.kernel.org, linux-kselftest@vger.kernel.org,
Andrii Nakryiko <andrii@kernel.org>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Martin KaFai Lau <martin.lau@linux.dev>,
Song Liu <song@kernel.org>,
Yonghong Song <yonghong.song@linux.dev>,
John Fastabend <john.fastabend@gmail.com>,
KP Singh <kpsingh@kernel.org>,
Stanislav Fomichev <sdf@fomichev.me>, Hao Luo <haoluo@google.com>,
Mykola Lysenko <mykolal@fb.com>, Shuah Khan <shuah@kernel.org>,
Jean-Philippe Brucker <jean-philippe@linaro.org>,
Viktor Malik <vmalik@redhat.com>
Subject: Re: [PATCH bpf-next v1 2/3] bpf: btf: Ensure natural alignment of .BTF_ids section
Date: Mon, 23 Sep 2024 04:39:17 -0700 [thread overview]
Message-ID: <24b280fe1c3bc9348b4b89a9b860827ed432a772.camel@gmail.com> (raw)
In-Reply-To: <ZvFJAJdEdK3wnyXs@krava>
On Mon, 2024-09-23 at 12:54 +0200, Jiri Olsa wrote:
[...]
> > > diff --git a/include/linux/btf_ids.h b/include/linux/btf_ids.h
> > > index c0e3e1426a82..c10b163dc340 100644
> > > --- a/include/linux/btf_ids.h
> > > +++ b/include/linux/btf_ids.h
> > > @@ -89,6 +89,7 @@ word \
> > > #define __BTF_ID_LIST(name, scope) \
> > > asm( \
> > > ".pushsection " BTF_IDS_SECTION ",\"a\"; \n" \
> > > +".balign 4, 0; \n" \
> > > "." #scope " " #name "; \n" \
> > > #name ":; \n" \
> > > ".popsection; \n");
> >
> > This forces all id list symbols to be aligned on 4 bytes.
> > Should the same be done for __BTF_SET_START?
>
> it seems all the set macros use __BTF_ID_LIST, so it should be taken
> care of by that
Apologies, I don't know how I missed __BTF_ID_LIST invocation in
the __BTF_SET_START definition :(
> > Also, is it guaranteed that all btf ids are organized in lists and sets?
> > Grepping through the code it seems they are, but it looks like resolve_btfids
> > does not really enforce this, simply looking for symbols matching a special name
> > __BTF_ID__<type>__<symbol>[__<id>] .
>
> yes, you need the BTF_ID to be part of list or set to be able to access it
>
> resolve_btfids does not enforce some loose BTF_ID definition without list/set,
> but that does not seem to be a problem
Understood, thank you.
next prev parent reply other threads:[~2024-09-23 11:39 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-20 7:49 [PATCH bpf-next v1 0/3] Improve .BTF_ids patching and alignment Tony Ambardar
2024-09-20 7:49 ` [PATCH bpf-next v1 1/3] tools/resolve_btfids: Simplify handling cross-endian compilation Tony Ambardar
2024-09-21 9:38 ` Eduard Zingerman
2024-09-23 10:55 ` Jiri Olsa
2024-10-14 12:56 ` Viktor Malik
2024-09-20 7:49 ` [PATCH bpf-next v1 2/3] bpf: btf: Ensure natural alignment of .BTF_ids section Tony Ambardar
2024-09-21 9:46 ` Eduard Zingerman
2024-09-23 10:54 ` Jiri Olsa
2024-09-23 11:39 ` Eduard Zingerman [this message]
2024-09-20 7:49 ` [PATCH bpf-next v1 3/3] tools/bpf, selftests/bpf : Sync btf_ids.h to tools Tony Ambardar
2024-09-23 11:07 ` [PATCH bpf-next v1 0/3] Improve .BTF_ids patching and alignment 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=24b280fe1c3bc9348b4b89a9b860827ed432a772.camel@gmail.com \
--to=eddyz87@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=haoluo@google.com \
--cc=jean-philippe@linaro.org \
--cc=john.fastabend@gmail.com \
--cc=kpsingh@kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=mykolal@fb.com \
--cc=olsajiri@gmail.com \
--cc=sdf@fomichev.me \
--cc=shuah@kernel.org \
--cc=song@kernel.org \
--cc=tony.ambardar@gmail.com \
--cc=vmalik@redhat.com \
--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;
as well as URLs for NNTP newsgroup(s).