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] [day] [month] [year] [list]
Date: Wed, 22 May 2024 17:34:33 +0200
From: Borislav Petkov <bp@...en8.de>
To: "Balasubrmanian, Vignesh" <vigbalas@....com>
Cc: Thomas Gleixner <tglx@...utronix.de>,
	"Balasubrmanian, Vignesh" <Vignesh.Balasubrmanian@....com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-toolchains@...r.kernel.org" <linux-toolchains@...r.kernel.org>,
	"mpe@...erman.id.au" <mpe@...erman.id.au>,
	"npiggin@...il.com" <npiggin@...il.com>,
	"christophe.leroy@...roup.eu" <christophe.leroy@...roup.eu>,
	"aneesh.kumar@...nel.org" <aneesh.kumar@...nel.org>,
	"naveen.n.rao@...ux.ibm.com" <naveen.n.rao@...ux.ibm.com>,
	"ebiederm@...ssion.com" <ebiederm@...ssion.com>,
	"keescook@...omium.org" <keescook@...omium.org>,
	"x86@...nel.org" <x86@...nel.org>,
	"linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>,
	"linux-mm@...ck.org" <linux-mm@...ck.org>,
	"George, Jini Susan" <JiniSusan.George@....com>,
	"matz@...e.de" <matz@...e.de>,
	"binutils@...rceware.org" <binutils@...rceware.org>,
	"jhb@...eBSD.org" <jhb@...ebsd.org>,
	"felix.willgerodt@...el.com" <felix.willgerodt@...el.com>
Subject: Re: [PATCH v2 1/1] x86/elf: Add a new .note section containing
 Xfeatures information to x86 core files

On Wed, May 22, 2024 at 06:42:55PM +0530, Balasubrmanian, Vignesh wrote:
> > > +enum custom_feature {
> > > +     FEATURE_XSAVE_FP = 0,
> > > +     FEATURE_XSAVE_SSE = 1,
> > > +     FEATURE_XSAVE_YMM = 2,
> > > +     FEATURE_XSAVE_BNDREGS = 3,
> > > +     FEATURE_XSAVE_BNDCSR = 4,
> > > +     FEATURE_XSAVE_OPMASK = 5,
> > > +     FEATURE_XSAVE_ZMM_Hi256 = 6,
> > > +     FEATURE_XSAVE_Hi16_ZMM = 7,
> > > +     FEATURE_XSAVE_PT = 8,
> > > +     FEATURE_XSAVE_PKRU = 9,
> > > +     FEATURE_XSAVE_PASID = 10,
> > > +     FEATURE_XSAVE_CET_USER = 11,
> > > +     FEATURE_XSAVE_CET_SHADOW_STACK = 12,
> > > +     FEATURE_XSAVE_HDC = 13,
> > > +     FEATURE_XSAVE_UINTR = 14,
> > > +     FEATURE_XSAVE_LBR = 15,
> > > +     FEATURE_XSAVE_HWP = 16,
> > > +     FEATURE_XSAVE_XTILE_CFG = 17,
> > > +     FEATURE_XSAVE_XTILE_DATA = 18,
> > > +     FEATURE_MAX,
> > > +     FEATURE_XSAVE_EXTENDED_START = FEATURE_XSAVE_YMM,
> > > +     FEATURE_XSAVE_EXTENDED_END = FEATURE_XSAVE_XTILE_DATA,
> > > +};
> > Why can't this use the existing 'enum xfeature' which is providing
> > exactly the same information already?
> First version of patch was similar to what you mentioned here and other
> review comments to use existing kernel definitions.
> https://lore.kernel.org/linux-mm/20240314112359.50713-1-vigbalas@amd.com/T/
> 
> As per the review comment https://lore.kernel.org/linux-mm/20240314162954.GAZfMmAnYQoRjRbRzc@fat_crate.local/
> , modified the patch to be a independent of kernel internal definitions.
> Though this enum and below function  "get_sub_leaf" are not useful now,  it
> will be required when we extend for a new/different features.

No, Thomas' sugggestion is to use the existing xfeature enum - not
define the same thing again.

Why do you need that enum custom_feature thing if you can use

/*
 * List of XSAVE features Linux knows about:
 */
enum xfeature {

from arch/x86/include/asm/fpu/types.h

?

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ