public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 5/9] x86-64 fix smp boot failure with thread_info change
@ 2005-11-30  4:21 Benjamin LaHaise
  0 siblings, 0 replies; only message in thread
From: Benjamin LaHaise @ 2005-11-30  4:21 UTC (permalink / raw)
  To: Andi Kleen; +Cc: linux-kernel

Make sure that stack_smp_processor_id() gets set for all CPUs regardless of 
which path we take in do_boot_cpu(), as well as in upcoming case where 
tsk->thread_info != task_thread_info(tsk).

Add a memory barrier to ensure this change is flushed before the other
CPU comes up.  My P4/HT machine was occasionally randomly failing to boot
without this barrier.

---

 arch/x86_64/kernel/smpboot.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

applies-to: ff25c960b7af25819aba4fbecbd94bd3500a3a4a
932262b117ba1c3a77078b64674e1a1823c169df
diff --git a/arch/x86_64/kernel/smpboot.c b/arch/x86_64/kernel/smpboot.c
index 50d018a..10b951b 100644
--- a/arch/x86_64/kernel/smpboot.c
+++ b/arch/x86_64/kernel/smpboot.c
@@ -780,6 +780,9 @@ do_rest:
 
 	cpu_pda[cpu].pcurrent = c_idle.idle;
 
+	/* set the CPU for stack_smp_processor_id() */
+	c_idle.idle->thread_info->cpu = cpu;
+
 	start_rip = setup_trampoline();
 
 	init_rsp = c_idle.idle->thread.rsp;
@@ -796,6 +799,7 @@ do_rest:
 	 * the targeted processor.
 	 */
 
+	mb();
 	atomic_set(&init_deasserted, 0);
 
 	Dprintk("Setting warm reset code and vector.\n");
---
0.99.9.GIT

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2005-11-30  4:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-30  4:21 [PATCH 5/9] x86-64 fix smp boot failure with thread_info change Benjamin LaHaise

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