]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
x86, xsave: update xsave header bits during ptrace fpregs set
authorSuresh Siddha <suresh.b.siddha@intel.com>
Tue, 29 Jul 2008 17:29:26 +0000 (10:29 -0700)
committerIngo Molnar <mingo@elte.hu>
Wed, 30 Jul 2008 17:49:28 +0000 (19:49 +0200)
FP/SSE bits may be zero in the xsave header(representing the init state).
Update these bits during the ptrace fpregs set operation, to indicate the
non-init state.

Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/kernel/i387.c

index cbb9dc474a21f95305b0d0d12b951c84716dd573..e0ed59f5c19f2cbe273f0383c96b8ade15d62549 100644 (file)
@@ -214,6 +214,13 @@ int xfpregs_set(struct task_struct *target, const struct user_regset *regset,
         */
        target->thread.xstate->fxsave.mxcsr &= mxcsr_feature_mask;
 
+       /*
+        * update the header bits in the xsave header, indicating the
+        * presence of FP and SSE state.
+        */
+       if (cpu_has_xsave)
+               target->thread.xstate->xsave.xsave_hdr.xstate_bv |= XSTATE_FPSSE;
+
        return ret;
 }
 
@@ -414,6 +421,12 @@ int fpregs_set(struct task_struct *target, const struct user_regset *regset,
        if (!ret)
                convert_to_fxsr(target, &env);
 
+       /*
+        * update the header bit in the xsave header, indicating the
+        * presence of FP.
+        */
+       if (cpu_has_xsave)
+               target->thread.xstate->xsave.xsave_hdr.xstate_bv |= XSTATE_FP;
        return ret;
 }