Merge branches 'x86-cleanups-for-linus', 'x86-vmware-for-linus', 'x86-mtrr-for-linus...
[sfrench/cifs-2.6.git] / arch / x86 / include / asm / i387.h
index c991b3a7b904bbfea99c5b74e423808eb55b1c56..f1accc625beb0983d7cc63044d415a7484c55065 100644 (file)
@@ -127,6 +127,15 @@ static inline int fxsave_user(struct i387_fxsave_struct __user *fx)
 {
        int err;
 
+       /*
+        * Clear the bytes not touched by the fxsave and reserved
+        * for the SW usage.
+        */
+       err = __clear_user(&fx->sw_reserved,
+                          sizeof(struct _fpx_sw_bytes));
+       if (unlikely(err))
+               return -EFAULT;
+
        asm volatile("1:  rex64/fxsave (%[fx])\n\t"
                     "2:\n"
                     ".section .fixup,\"ax\"\n"
@@ -482,6 +491,8 @@ static inline void fpu_copy(struct fpu *dst, struct fpu *src)
        memcpy(dst->state, src->state, xstate_size);
 }
 
+extern void fpu_finit(struct fpu *fpu);
+
 #endif /* __ASSEMBLY__ */
 
 #define PSHUFB_XMM5_XMM0 .byte 0x66, 0x0f, 0x38, 0x00, 0xc5