]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - arch/x86/include/asm/i387.h
Merge branch 'x86-xsave-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[net-next-2.6.git] / arch / x86 / include / asm / i387.h
index 509ddabeae2535013495205091858f2c3143243b..a73a8d5a5e6963e6fef9b52c28666e913a74160c 100644 (file)
@@ -140,6 +140,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"
@@ -495,6 +504,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