Re: [PATCH bpf-next v1 2/3] bpf: btf: Ensure natural alignment of .BTF_ids section

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.






[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux