
From: Shaohua Li <shaohua.li@intel.com>

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>
---

 arch/i386/power/cpu.c        |   15 ++++++++-------
 arch/x86_64/kernel/suspend.c |   14 ++++++++------
 2 files changed, 16 insertions(+), 13 deletions(-)

diff -puN arch/i386/power/cpu.c~fpu-context-corrupted-after-resume arch/i386/power/cpu.c
--- devel/arch/i386/power/cpu.c~fpu-context-corrupted-after-resume	2005-09-14 19:49:49.000000000 -0700
+++ devel-akpm/arch/i386/power/cpu.c	2005-09-14 19:51:44.000000000 -0700
@@ -68,16 +68,17 @@ 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.
+	 *
+	 * Do it out of line so that gcc does not move cr0 load to some stupid
+	 * place
+	 */
+	kernel_fpu_end();
 }
 
-
 static void fix_processor_context(void)
 {
 	int cpu = smp_processor_id();
diff -puN arch/x86_64/kernel/suspend.c~fpu-context-corrupted-after-resume arch/x86_64/kernel/suspend.c
--- devel/arch/x86_64/kernel/suspend.c~fpu-context-corrupted-after-resume	2005-09-14 19:49:49.000000000 -0700
+++ devel-akpm/arch/x86_64/kernel/suspend.c	2005-09-14 19:51:37.000000000 -0700
@@ -61,13 +61,15 @@ 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
+	 *
+	 * Do it out of line so that gcc does not move cr0 load to some stupid
+	 * place
+	 */
+	kernel_fpu_end();
 }
 
 void __restore_processor_state(struct saved_context *ctxt)
_
