public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* PATCH? process_32.c:__switch_to() calls __math_state_restore() before updating current_task
@ 2010-02-04 16:51 Oleg Nesterov
  2010-02-04 17:40 ` Suresh Siddha
  0 siblings, 1 reply; 7+ messages in thread
From: Oleg Nesterov @ 2010-02-04 16:51 UTC (permalink / raw)
  To: Arjan van de Ven, Jeremy Fitzhardinge, Suresh Siddha; +Cc: linux-kernel

I didn't try to verify __switch_to()->__math_state_restore() is really
wrong, this is more the question than the patch. But at least the code
looks wrong, it calls __math_state_restore() which uses curent before
current_task was updated.

Uncompiled/untested.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>

--- a/arch/x86/kernel/process_32.c
+++ b/arch/x86/kernel/process_32.c
@@ -377,9 +377,6 @@ __switch_to(struct task_struct *prev_p, 
 	 */
 	arch_end_context_switch(next_p);
 
-	if (preload_fpu)
-		__math_state_restore();
-
 	/*
 	 * Restore %gs if needed (which is common)
 	 */
@@ -388,6 +385,9 @@ __switch_to(struct task_struct *prev_p, 
 
 	percpu_write(current_task, next_p);
 
+	if (preload_fpu)
+		__math_state_restore();
+
 	return prev_p;
 }
 


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-02-08 20:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-04 16:51 PATCH? process_32.c:__switch_to() calls __math_state_restore() before updating current_task Oleg Nesterov
2010-02-04 17:40 ` Suresh Siddha
2010-02-05 12:44   ` Oleg Nesterov
2010-02-06 12:06     ` Oleg Nesterov
2010-02-06 12:08       ` Oleg Nesterov
2010-02-08 18:48     ` Suresh Siddha
2010-02-08 20:26       ` Oleg Nesterov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox