Skip to content

Commit 91969d6

Browse files
author
Ingo Molnar
committed
x86/fpu: Move xfeature type enumeration to fpu/types.h
So xsave.h is an internal header that FPU using drivers commonly include, to get access to the xstate feature names, amongst other things. Move these type definitions to fpu/fpu.h to allow simplification of FPU using driver code. Cc: Andy Lutomirski <luto@amacapital.net> Cc: Borislav Petkov <bp@alien8.de> Cc: Dave Hansen <dave.hansen@linux.intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 677b98b commit 91969d6

File tree

2 files changed

+28
-28
lines changed

2 files changed

+28
-28
lines changed

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,34 @@ struct i387_soft_struct {
7878
u32 entry_eip;
7979
};
8080

81+
/*
82+
* List of XSAVE features Linux knows about:
83+
*/
84+
enum xfeature_bit {
85+
XSTATE_BIT_FP,
86+
XSTATE_BIT_SSE,
87+
XSTATE_BIT_YMM,
88+
XSTATE_BIT_BNDREGS,
89+
XSTATE_BIT_BNDCSR,
90+
XSTATE_BIT_OPMASK,
91+
XSTATE_BIT_ZMM_Hi256,
92+
XSTATE_BIT_Hi16_ZMM,
93+
94+
XFEATURES_NR_MAX,
95+
};
96+
97+
#define XSTATE_FP (1 << XSTATE_BIT_FP)
98+
#define XSTATE_SSE (1 << XSTATE_BIT_SSE)
99+
#define XSTATE_YMM (1 << XSTATE_BIT_YMM)
100+
#define XSTATE_BNDREGS (1 << XSTATE_BIT_BNDREGS)
101+
#define XSTATE_BNDCSR (1 << XSTATE_BIT_BNDCSR)
102+
#define XSTATE_OPMASK (1 << XSTATE_BIT_OPMASK)
103+
#define XSTATE_ZMM_Hi256 (1 << XSTATE_BIT_ZMM_Hi256)
104+
#define XSTATE_Hi16_ZMM (1 << XSTATE_BIT_Hi16_ZMM)
105+
106+
#define XSTATE_FPSSE (XSTATE_FP | XSTATE_SSE)
107+
#define XSTATE_AVX512 (XSTATE_OPMASK | XSTATE_ZMM_Hi256 | XSTATE_Hi16_ZMM)
108+
81109
/*
82110
* There are 16x 256-bit AVX registers named YMM0-YMM15.
83111
* The low 128 bits are aliased to the 16 SSE registers (XMM0-XMM15)

arch/x86/include/asm/fpu/xstate.h

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,6 @@
44
#include <linux/types.h>
55
#include <asm/processor.h>
66

7-
/*
8-
* List of XSAVE features Linux knows about:
9-
*/
10-
enum xfeature_bit {
11-
XSTATE_BIT_FP,
12-
XSTATE_BIT_SSE,
13-
XSTATE_BIT_YMM,
14-
XSTATE_BIT_BNDREGS,
15-
XSTATE_BIT_BNDCSR,
16-
XSTATE_BIT_OPMASK,
17-
XSTATE_BIT_ZMM_Hi256,
18-
XSTATE_BIT_Hi16_ZMM,
19-
20-
XFEATURES_NR_MAX,
21-
};
22-
23-
#define XSTATE_FP (1 << XSTATE_BIT_FP)
24-
#define XSTATE_SSE (1 << XSTATE_BIT_SSE)
25-
#define XSTATE_YMM (1 << XSTATE_BIT_YMM)
26-
#define XSTATE_BNDREGS (1 << XSTATE_BIT_BNDREGS)
27-
#define XSTATE_BNDCSR (1 << XSTATE_BIT_BNDCSR)
28-
#define XSTATE_OPMASK (1 << XSTATE_BIT_OPMASK)
29-
#define XSTATE_ZMM_Hi256 (1 << XSTATE_BIT_ZMM_Hi256)
30-
#define XSTATE_Hi16_ZMM (1 << XSTATE_BIT_Hi16_ZMM)
31-
32-
33-
#define XSTATE_FPSSE (XSTATE_FP | XSTATE_SSE)
34-
#define XSTATE_AVX512 (XSTATE_OPMASK | XSTATE_ZMM_Hi256 | XSTATE_Hi16_ZMM)
357
/* Bit 63 of XCR0 is reserved for future expansion */
368
#define XSTATE_EXTEND_MASK (~(XSTATE_FPSSE | (1ULL << 63)))
379

0 commit comments

Comments
 (0)