[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1a3553f2c6b7c6905ffc5daae3d42ac1aa66353a.camel@intel.com>
Date: Thu, 20 Feb 2020 12:23:00 -0800
From: Yu-cheng Yu <yu-cheng.yu@...el.com>
To: Borislav Petkov <bp@...en8.de>
Cc: linux-kernel@...r.kernel.org, x86@...nel.org,
"H. Peter Anvin" <hpa@...or.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Tony Luck <tony.luck@...el.com>,
Andy Lutomirski <luto@...nel.org>,
Rik van Riel <riel@...riel.com>,
"Ravi V. Shankar" <ravi.v.shankar@...el.com>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
Fenghua Yu <fenghua.yu@...el.com>,
Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH v2 1/8] x86/fpu/xstate: Define new macros for supervisor
and user xstates
On Thu, 2020-02-20 at 12:47 +0100, Borislav Petkov wrote:
> On Tue, Jan 21, 2020 at 12:18:36PM -0800, Yu-cheng Yu wrote:
> > From: Fenghua Yu <fenghua.yu@...el.com>
> > [...]
> > +/* All currently supported supervisor features */
> > +#define SUPPORTED_XFEATURES_MASK_SUPERVISOR (0)
> > +
> > +/*
> > + * Unsupported supervisor features. When a supervisor feature in this mask is
> > + * supported in the future, move it to the supported supervisor feature mask.
> > + */
> > +#define UNSUPPORTED_XFEATURES_MASK_SUPERVISOR (XFEATURE_MASK_PT)
> > +
> > +/* All supervisor states including supported and unsupported states. */
> > +#define ALL_XFEATURES_MASK_SUPERVISOR (SUPPORTED_XFEATURES_MASK_SUPERVISOR | \
> > + UNSUPPORTED_XFEATURES_MASK_SUPERVISOR)
>
> So frankly having the namespace prepended in those macros makes it more
> readable to me: you know that those masks all belong together if you had
> this:
>
> XFEATURE_MASK_SUPERVISOR
> XFEATURE_MASK_SUPERVISOR_SUPPORTED
> XFEATURE_MASK_SUPERVISOR_UNSUPPORTED
> XFEATURE_MASK_SUPERVISOR_ALL
> XFEATURE_MASK_USER_SUPPORTED
>
> Now they all begin with different words: "ALL", "UNSUPPORTED",
> "SUPPORTED", ... and makes you go and look up the mask to make sure it
> is the correct type of mask used.
>
> Even more so if the single feature masks also start with
> "XFEATURE_MASK_" so it is only logical to have them all start with
> XFEATURE_MASK_ IMO.
I will make the changes.
Yu-cheng
Powered by blists - more mailing lists