Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1214020

Re: [PATCH 02/11] x86, fpu: rename xfeature_bit

From Dave Hansen <dave@sr71.net>
Newsgroups linux.kernel
Subject Re: [PATCH 02/11] x86, fpu: rename xfeature_bit
Date 2015-08-26 18:20 +0200
Message-ID <q1LAD-2ow-31@gated-at.bofh.it> (permalink)
References <q1sRk-ky-7@gated-at.bofh.it> <q1sRm-ky-49@gated-at.bofh.it> <q1LqY-2d7-97@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 08/26/2015 09:06 AM, Borislav Petkov wrote:
>> > -enum xfeature_bit {
>> > -	XSTATE_BIT_FP,
>> > -	XSTATE_BIT_SSE,
>> > -	XSTATE_BIT_YMM,
>> > -	XSTATE_BIT_BNDREGS,
>> > -	XSTATE_BIT_BNDCSR,
>> > -	XSTATE_BIT_OPMASK,
>> > -	XSTATE_BIT_ZMM_Hi256,
>> > -	XSTATE_BIT_Hi16_ZMM,
>> > +enum xfeature_nr {
>> > +	XFEATURE_NR_FP,
>> > +	XFEATURE_NR_SSE,
>> > +	/*
>> > +	 * Values above here are "legacy states".
>> > +	 * Those below are "extended states".
>> > +	 */
>> > +	XFEATURE_NR_YMM,
>> > +	XFEATURE_NR_BNDREGS,
>> > +	XFEATURE_NR_BNDCSR,
>> > +	XFEATURE_NR_OPMASK,
>> > +	XFEATURE_NR_ZMM_Hi256,
>> > +	XFEATURE_NR_Hi16_ZMM,
> Why not simply
> 
> s/NR_//
> 
> ?
> 
> I.e., XFEATURE_FP, XFEATURE_SSE and so on...

I wanted to differentiate them from the

#define XSTATE_FP               (1 << XSTATE_BIT_FP)
#define XSTATE_SSE              (1 << XSTATE_BIT_SSE)

defines below.  Those are really XFEATURE_MASK_...  I think this gets a
lots more clear if you have a pair of #defines like:

	XFEATURE_NR_BNDREGS
	XFEATURE_MASK_BNDREGS

It's pretty obvious what's going on there.  What we have now is

	XSTATE_BIT_BNDREGS
	XSTATE_BNDREGS

which I find much less clear.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/11] x86, fpu: XSAVE cleanups and sanity checks Dave Hansen <dave@sr71.net> - 2015-08-25 22:20 +0200
  [PATCH 03/11] x86, fpu: rework XSTATE_* macros to remove magic '2' Dave Hansen <dave@sr71.net> - 2015-08-25 22:20 +0200
  [PATCH 11/11] x86, fpu: check CPU-provided sizes against struct declarations Dave Hansen <dave@sr71.net> - 2015-08-25 22:20 +0200
    Re: [PATCH 11/11] x86, fpu: check CPU-provided sizes against struct  declarations Dave Hansen <dave@sr71.net> - 2015-08-26 18:20 +0200
    Re: [PATCH 11/11] x86, fpu: check CPU-provided sizes against struct  declarations Tim Chen <tim.c.chen@linux.intel.com> - 2015-08-26 18:20 +0200
  [PATCH 06/11] x86, fpu: rework MPX 'xstate' types Dave Hansen <dave@sr71.net> - 2015-08-25 22:20 +0200
  [PATCH 02/11] x86, fpu: rename xfeature_bit Dave Hansen <dave@sr71.net> - 2015-08-25 22:20 +0200
    Re: [PATCH 02/11] x86, fpu: rename xfeature_bit Borislav Petkov <bp@alien8.de> - 2015-08-26 18:10 +0200
      Re: [PATCH 02/11] x86, fpu: rename xfeature_bit Dave Hansen <dave@sr71.net> - 2015-08-26 18:20 +0200
  [PATCH 09/11] x86, fpu: correct and check XSAVE xstate size calculations Dave Hansen <dave@sr71.net> - 2015-08-25 22:20 +0200
  [PATCH 05/11] x86, fpu: add helper xfeature_nr_enabled() instead of test_bit() Dave Hansen <dave@sr71.net> - 2015-08-25 22:20 +0200
  [PATCH 07/11] x86, fpu: rework YMM definition Dave Hansen <dave@sr71.net> - 2015-08-25 22:20 +0200
  [PATCH 01/11] x86, fpu: kill LWP support Dave Hansen <dave@sr71.net> - 2015-08-25 22:20 +0200

csiph-web