[PATCH] FPU context corrupted after resume
authorShaohua Li <shaohua.li@intel.com>
Sun, 30 Oct 2005 22:59:28 +0000 (14:59 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 31 Oct 2005 01:37:11 +0000 (17:37 -0800)
mxcsr_feature_mask_init isn't needed in suspend/resume time (we can use
boot time mask).  And actually it's harmful, as it clear task's saved
fxsave in resume.  This bug is widely seen by users using zsh.

(akpm: my eyes.  Fixed some surrounding whitespace mess)

Signed-off-by: Shaohua Li<shaohua.li@intel.com>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Andi Kleen <ak@muc.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/i386/power/cpu.c
arch/x86_64/kernel/suspend.c

index b27c5ac..1f15726 100644 (file)
@@ -51,16 +51,14 @@ void save_processor_state(void)
        __save_processor_state(&saved_context);
 }
 
-static void
-do_fpu_end(void)
+static void do_fpu_end(void)
 {
-        /* restore FPU regs if necessary */
-       /* Do it out of line so that gcc does not move cr0 load to some stupid place */
-        kernel_fpu_end();
-       mxcsr_feature_mask_init();
+       /*
+        * Restore FPU regs if necessary.
+        */
+       kernel_fpu_end();
 }
 
-
 static void fix_processor_context(void)
 {
        int cpu = smp_processor_id();
index f066c6a..0251682 100644 (file)
@@ -63,13 +63,12 @@ void save_processor_state(void)
        __save_processor_state(&saved_context);
 }
 
-static void
-do_fpu_end(void)
+static void do_fpu_end(void)
 {
-        /* restore FPU regs if necessary */
-       /* Do it out of line so that gcc does not move cr0 load to some stupid place */
-        kernel_fpu_end();
-       mxcsr_feature_mask_init();
+       /*
+        * Restore FPU regs if necessary
+        */
+       kernel_fpu_end();
 }
 
 void __restore_processor_state(struct saved_context *ctxt)