Re: [PATCH bpf-next 0/1] use preserve_static_offset in bpf uapi headers

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

 



On Fri, 2023-12-08 at 15:35 +0000, Alan Maguire wrote:
[...]
> > Tbh, I like the decl tag approach a bit more too.
> > Although macro definition would be somewhat ridiculous:
> > 
> >     #if __has_attribute(preserve_static_offset) && defined(__bpf__)
> >     #define __bpf_ctx __attribute__((preserve_static_offset)) \
> >                       __attribute__((btf_decl_tag("preserve_static_offset")))
> >     #else
> >     #define __bpf_ctx
> >     #endif
> > 
> 
> As macro definitions go, that's not that ridiculous ;-)

Fair enough :)

> If we add it to vmlinux.h, would be good to have a
> 
> #ifdef BPF_NO_PRESERVE_STATIC_OFFSET
> #undef __bpf_ctx
> #define __bpf_ctx
> #endif
> 
> ...too, just in case the user wanted to use CO-RE with any of the types
> covered. Thanks!

Will do.

Thanks,
Eduard.





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux