diff options
Diffstat (limited to 'arch/x86/include/asm/i387.h')
-rw-r--r-- | arch/x86/include/asm/i387.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h index c991b3a7b904..f1accc625beb 100644 --- a/arch/x86/include/asm/i387.h +++ b/arch/x86/include/asm/i387.h | |||
@@ -127,6 +127,15 @@ static inline int fxsave_user(struct i387_fxsave_struct __user *fx) | |||
127 | { | 127 | { |
128 | int err; | 128 | int err; |
129 | 129 | ||
130 | /* | ||
131 | * Clear the bytes not touched by the fxsave and reserved | ||
132 | * for the SW usage. | ||
133 | */ | ||
134 | err = __clear_user(&fx->sw_reserved, | ||
135 | sizeof(struct _fpx_sw_bytes)); | ||
136 | if (unlikely(err)) | ||
137 | return -EFAULT; | ||
138 | |||
130 | asm volatile("1: rex64/fxsave (%[fx])\n\t" | 139 | asm volatile("1: rex64/fxsave (%[fx])\n\t" |
131 | "2:\n" | 140 | "2:\n" |
132 | ".section .fixup,\"ax\"\n" | 141 | ".section .fixup,\"ax\"\n" |
@@ -482,6 +491,8 @@ static inline void fpu_copy(struct fpu *dst, struct fpu *src) | |||
482 | memcpy(dst->state, src->state, xstate_size); | 491 | memcpy(dst->state, src->state, xstate_size); |
483 | } | 492 | } |
484 | 493 | ||
494 | extern void fpu_finit(struct fpu *fpu); | ||
495 | |||
485 | #endif /* __ASSEMBLY__ */ | 496 | #endif /* __ASSEMBLY__ */ |
486 | 497 | ||
487 | #define PSHUFB_XMM5_XMM0 .byte 0x66, 0x0f, 0x38, 0x00, 0xc5 | 498 | #define PSHUFB_XMM5_XMM0 .byte 0x66, 0x0f, 0x38, 0x00, 0xc5 |