lkml.org 
[lkml]   [2015]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 02/11] x86, fpu: rename xfeature_bit
From
Date

From: Dave Hansen <dave.hansen@linux.intel.com>

The 'xfeature_bit's are at best xfeature bit _numbers_. Calling
them bits is at best inconsistent with ending the enum list with
'XFEATURES_NR_MAX'.

This patch renames the enum to be 'xfeature_nr'. These also
happen to be what the Intel documentation calls a "state
component".

Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: x86@kernel.org
Cc: Borislav Petkov <bp@alien8.de>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Tim Chen <tim.c.chen@linux.intel.com>
Cc: linux-kernel@vger.kernel.org
---

b/arch/x86/include/asm/fpu/types.h | 38 ++++++++++++++++++++-----------------
1 file changed, 21 insertions(+), 17 deletions(-)

diff -puN arch/x86/include/asm/fpu/types.h~x86-fpu-rename-xfeature_bit arch/x86/include/asm/fpu/types.h
--- a/arch/x86/include/asm/fpu/types.h~x86-fpu-rename-xfeature_bit 2015-08-25 12:49:58.393504548 -0700
+++ b/arch/x86/include/asm/fpu/types.h 2015-08-25 12:49:58.396504684 -0700
@@ -95,27 +95,31 @@ struct swregs_state {
/*
* List of XSAVE features Linux knows about:
*/
-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,

XFEATURES_NR_MAX,
};

-#define XSTATE_FP (1 << XSTATE_BIT_FP)
-#define XSTATE_SSE (1 << XSTATE_BIT_SSE)
-#define XSTATE_YMM (1 << XSTATE_BIT_YMM)
-#define XSTATE_BNDREGS (1 << XSTATE_BIT_BNDREGS)
-#define XSTATE_BNDCSR (1 << XSTATE_BIT_BNDCSR)
-#define XSTATE_OPMASK (1 << XSTATE_BIT_OPMASK)
-#define XSTATE_ZMM_Hi256 (1 << XSTATE_BIT_ZMM_Hi256)
-#define XSTATE_Hi16_ZMM (1 << XSTATE_BIT_Hi16_ZMM)
+#define XSTATE_FP (1 << XFEATURE_NR_FP)
+#define XSTATE_SSE (1 << XFEATURE_NR_SSE)
+#define XSTATE_YMM (1 << XFEATURE_NR_YMM)
+#define XSTATE_BNDREGS (1 << XFEATURE_NR_BNDREGS)
+#define XSTATE_BNDCSR (1 << XFEATURE_NR_BNDCSR)
+#define XSTATE_OPMASK (1 << XFEATURE_NR_OPMASK)
+#define XSTATE_ZMM_Hi256 (1 << XFEATURE_NR_ZMM_Hi256)
+#define XSTATE_Hi16_ZMM (1 << XFEATURE_NR_Hi16_ZMM)

#define XSTATE_FPSSE (XSTATE_FP | XSTATE_SSE)
#define XSTATE_AVX512 (XSTATE_OPMASK | XSTATE_ZMM_Hi256 | XSTATE_Hi16_ZMM)
_

\
 
 \ /
  Last update: 2015-08-25 22:21    [W:0.326 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site