x86/fpu: Get rid of copy_supervisor_to_kernel()
[linux-2.6-microblaze.git] / arch / x86 / kernel / fpu / signal.c
index 888c8e0..5010595 100644 (file)
@@ -401,15 +401,18 @@ static int __fpu__restore_sig(void __user *buf, void __user *buf_fx, int size)
         * the optimisation).
         */
        fpregs_lock();
-
        if (!test_thread_flag(TIF_NEED_FPU_LOAD)) {
-
                /*
-                * Supervisor states are not modified by user space input.  Save
-                * current supervisor states first and invalidate the FPU regs.
+                * If supervisor states are available then save the
+                * hardware state in current's fpstate so that the
+                * supervisor state is preserved. Save the full state for
+                * simplicity. There is no point in optimizing this by only
+                * saving the supervisor states and then shuffle them to
+                * the right place in memory. This is the slow path and the
+                * above XRSTOR failed or ia32_fxstate is true. Shrug.
                 */
                if (xfeatures_mask_supervisor())
-                       copy_supervisor_to_kernel(&fpu->state.xsave);
+                       copy_xregs_to_kernel(&fpu->state.xsave);
                set_thread_flag(TIF_NEED_FPU_LOAD);
        }
        __fpu_invalidate_fpregs_state(fpu);