lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <446p3sgkjndfa45dqfy7a3nu5nfbczn55eazpkup6b46zi5vnw@eu7us32trhcc>
Date: Wed, 10 Jan 2024 18:27:13 -0700
From: Daniel Xu <dxu@...uu.xyz>
To: Lorenz Bauer <lorenz.bauer@...valent.com>
Cc: andrii@...nel.org, ast@...nel.org, daniel@...earbox.net, 
	martin.lau@...ux.dev, alexei.starovoitov@...il.com, olsajiri@...il.com, 
	quentin@...valent.com, alan.maguire@...cle.com, memxor@...il.com, song@...nel.org, 
	yonghong.song@...ux.dev, john.fastabend@...il.com, kpsingh@...nel.org, sdf@...gle.com, 
	haoluo@...gle.com, jolsa@...nel.org, bpf@...r.kernel.org, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH bpf-next v3 2/3] bpf: btf: Add BTF_KFUNCS_START/END macro
 pair

On Mon, Jan 08, 2024 at 10:59:53AM -0700, Daniel Xu wrote:
> On Mon, Jan 08, 2024 at 10:14:13AM +0100, Lorenz Bauer wrote:
> > On Sat, Jan 6, 2024 at 7:25 PM Daniel Xu <dxu@...uu.xyz> wrote:
> > >
> > > This macro pair is functionally equivalent to BTF_SET8_START/END, except
> > > with BTF_SET8_KFUNCS flag set in the btf_id_set8 flags field. The next
> > > commit will codemod all kfunc set8s to this new variant such that all
> > > kfuncs are tagged as such in .BTF_ids section.
> > >
> > > Signed-off-by: Daniel Xu <dxu@...uu.xyz>
> > > ---
> > >  include/linux/btf_ids.h | 11 +++++++++++
> > >  1 file changed, 11 insertions(+)
> > >
> > > diff --git a/include/linux/btf_ids.h b/include/linux/btf_ids.h
> > > index dca09b7f21dc..0fe4f1cd1918 100644
> > > --- a/include/linux/btf_ids.h
> > > +++ b/include/linux/btf_ids.h
> > > @@ -8,6 +8,9 @@ struct btf_id_set {
> > >         u32 ids[];
> > >  };
> > >
> > > +/* This flag implies BTF_SET8 holds kfunc(s) */
> > > +#define BTF_SET8_KFUNCS                (1 << 0)
> > 
> > Nit: could this be an enum so that the flag is discoverable via BTF?
> 
> Sure, makes sense.

I took a look - don't think we can make it an enum. See
include/linux/btf.h:

      /* These need to be macros, as the expressions are used in assembler input */
      #define KF_ACQUIRE      (1 << 0) /* kfunc is an acquire function */
      #define KF_RELEASE      (1 << 1) /* kfunc is a release function */
      [..]

Could do some redefines but maybe not worth it. The new flag is a pretty
deep impl detail anyways.

Thanks,
Daniel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ