Go to the documentation of this file. 1 #ifndef __ASM_X86_XSAVE_H
2 #define __ASM_X86_XSAVE_H
4 #include <linux/types.h>
5 #include <asm/processor.h>
7 #define XSTATE_CPUID 0x0000000d
10 #define XSTATE_SSE 0x2
11 #define XSTATE_YMM 0x4
13 #define XSTATE_FPSSE (XSTATE_FP | XSTATE_SSE)
15 #define FXSAVE_SIZE 512
17 #define XSAVE_HDR_SIZE 64
18 #define XSAVE_HDR_OFFSET FXSAVE_SIZE
20 #define XSAVE_YMM_SIZE 256
21 #define XSAVE_YMM_OFFSET (XSAVE_HDR_SIZE + XSAVE_HDR_OFFSET)
26 #define XCNTXT_MASK (XSTATE_FP | XSTATE_SSE | XSTATE_YMM)
29 #define REX_PREFIX "0x48, "
47 asm volatile(
"1: .byte " REX_PREFIX "0x0f,0xae,0x2f\n\t"
49 ".section .fixup,\"ax\"\n"
50 "3: movl $-1,%[err]\n"
55 :
"D" (fx),
"m" (*fx),
"a" (-1),
"d" (-1),
"0" (0)
69 err =
__clear_user(&buf->xsave_hdr,
sizeof(buf->xsave_hdr));
76 ".section .fixup,\"ax\"\n"
77 "3: movl $-1,%[err]\n"
82 :
"D" (buf),
"a" (-1),
"d" (-1),
"0" (0)
92 u32 hmask = mask >> 32;
97 ".section .fixup,\"ax\"\n"
98 "3: movl $-1,%[err]\n"
103 :
"D" (xstate),
"a" (lmask),
"d" (hmask),
"0" (0)
111 u32 hmask = mask >> 32;
113 asm volatile(
".byte " REX_PREFIX "0x0f,0xae,0x2f\n\t"
114 : :
"D" (
fx),
"m" (*fx),
"a" (lmask),
"d" (hmask)
121 u32 hmask = mask >> 32;
123 asm volatile(
".byte " REX_PREFIX "0x0f,0xae,0x27\n\t"
124 : :
"D" (
fx),
"m" (*fx),
"a" (lmask),
"d" (hmask)
128 static inline void fpu_xsave(
struct fpu *
fpu)
136 [fx]
"D" (&fpu->
state->
xsave),
"a" (-1),
"d" (-1) :