From: Oleg Nesterov <oleg@redhat.com>
To: Arjan van de Ven <arjan@linux.intel.com>,
Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>,
Suresh Siddha <suresh.b.siddha@intel.com>
Cc: linux-kernel@vger.kernel.org
Subject: PATCH? process_32.c:__switch_to() calls __math_state_restore() before updating current_task
Date: Thu, 4 Feb 2010 17:51:05 +0100 [thread overview]
Message-ID: <20100204165105.GA5905@redhat.com> (raw)
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;
}
next reply other threads:[~2010-02-04 16:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-04 16:51 Oleg Nesterov [this message]
2010-02-04 17:40 ` PATCH? process_32.c:__switch_to() calls __math_state_restore() before updating current_task 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100204165105.GA5905@redhat.com \
--to=oleg@redhat.com \
--cc=arjan@linux.intel.com \
--cc=jeremy.fitzhardinge@citrix.com \
--cc=linux-kernel@vger.kernel.org \
--cc=suresh.b.siddha@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox