Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 08967f94 authored by Shaohua Li's avatar Shaohua Li Committed by Linus Torvalds
Browse files

[PATCH] FPU context corrupted after resume



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: default avatarShaohua <Li&lt;shaohua.li@intel.com>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Andi Kleen <ak@muc.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 8896fab3
Loading
Loading
Loading
Loading
+5 −7
Original line number Original line Diff line number Diff line
@@ -51,16 +51,14 @@ void save_processor_state(void)
	__save_processor_state(&saved_context);
	__save_processor_state(&saved_context);
}
}


static void
static void do_fpu_end(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 */
	 * Restore FPU regs if necessary.
	 */
	kernel_fpu_end();
	kernel_fpu_end();
	mxcsr_feature_mask_init();
}
}



static void fix_processor_context(void)
static void fix_processor_context(void)
{
{
	int cpu = smp_processor_id();
	int cpu = smp_processor_id();
+5 −6
Original line number Original line Diff line number Diff line
@@ -63,13 +63,12 @@ void save_processor_state(void)
	__save_processor_state(&saved_context);
	__save_processor_state(&saved_context);
}
}


static void
static void do_fpu_end(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 */
	 * Restore FPU regs if necessary
	 */
	kernel_fpu_end();
	kernel_fpu_end();
	mxcsr_feature_mask_init();
}
}


void __restore_processor_state(struct saved_context *ctxt)
void __restore_processor_state(struct saved_context *ctxt)