--- linux-2.6.9/arch/i386/kernel/process-xen.c.orig	2010-01-11 19:46:41.000000000 -0500
+++ linux-2.6.9/arch/i386/kernel/process-xen.c	2010-01-11 19:48:32.000000000 -0500
@@ -57,6 +57,7 @@
 
 #include <xen/interface/physdev.h>
 #include <xen/interface/vcpu.h>
+#include <xen/cpu_hotplug.h>
 
 #include <linux/irq.h>
 #include <linux/err.h>
@@ -118,10 +119,7 @@
 	cpu_clear(smp_processor_id(), cpu_initialized);
 	preempt_enable_no_resched();
 	HYPERVISOR_vcpu_op(VCPUOP_down, smp_processor_id(), NULL);
-	/* Same as arch/xen/kernel/smpboot.c:cpu_bringup(). */
-	cpu_init();
-	preempt_disable();
-	local_irq_enable();
+	cpu_bringup();
 }
 #endif
 
--- linux-2.6.9/arch/i386/kernel/time-xen.c.orig	2010-01-11 19:46:50.000000000 -0500
+++ linux-2.6.9/arch/i386/kernel/time-xen.c	2010-01-11 19:48:32.000000000 -0500
@@ -876,7 +876,7 @@
  * stop_hz_timer / start_hz_timer - enter/exit 'tickless mode' on an idle cpu
  * These functions are based on implementations from arch/s390/kernel/time.c
  */
-void stop_hz_timer(void)
+static void stop_hz_timer(void)
 {
 	unsigned int cpu = smp_processor_id();
 	unsigned long j;
@@ -897,7 +897,7 @@
 		BUG();
 }
 
-void start_hz_timer(void)
+static void start_hz_timer(void)
 {
 	cpu_clear(smp_processor_id(), nohz_cpu_mask);
 }
--- linux-2.6.9/arch/x86_64/kernel/process-xen.c.orig	2010-01-11 19:46:41.000000000 -0500
+++ linux-2.6.9/arch/x86_64/kernel/process-xen.c	2010-01-11 19:48:32.000000000 -0500
@@ -57,6 +57,8 @@
 #include <asm/hardirq.h>
 #include <asm/ia32.h>
 
+#include <xen/cpu_hotplug.h>
+
 asmlinkage extern void ret_from_fork(void);
 
 unsigned long kernel_thread_flags = CLONE_VM | CLONE_UNTRACED;
@@ -105,10 +107,7 @@
 	cpu_clear(smp_processor_id(), cpu_initialized);
 	preempt_enable_no_resched();
 	HYPERVISOR_vcpu_op(VCPUOP_down, smp_processor_id(), NULL);
-	/* Same as arch/xen/kernel/smpboot.c:cpu_bringup(). */
-	cpu_init();
-	preempt_disable();
-	local_irq_enable();
+	cpu_bringup();
 }
 #endif
 
--- linux-2.6.9/arch/x86_64/kernel/setup64-xen.c.orig	2010-01-11 19:46:41.000000000 -0500
+++ linux-2.6.9/arch/x86_64/kernel/setup64-xen.c	2010-01-11 19:48:32.000000000 -0500
@@ -35,7 +35,6 @@
 
 char x86_boot_params[2048] __initdata = {0,};
 
-// unsigned long cpu_initialized __initdata = 0;
 cpumask_t cpu_initialized __initdata = CPU_MASK_NONE;
 
 struct x8664_pda cpu_pda[NR_CPUS] __cacheline_aligned; 
@@ -256,8 +255,6 @@
 					XENFEAT_writable_page_tables);
 	}
 	set_pml4(level4 + 510, mk_kernel_pml4(__pa_symbol(boot_vmalloc_pgt)));
-	// already done by switch_pt ??
-	// asm volatile("movq %0,%%cr3" :: "r" (__pa(level4))); 
 
 	switch_pt(level4);
 
--- linux-2.6.9/drivers/xen/core/smpboot.c.orig	2010-01-11 19:47:05.000000000 -0500
+++ linux-2.6.9/drivers/xen/core/smpboot.c	2010-01-11 19:48:32.000000000 -0500
@@ -92,6 +92,8 @@
 unsigned int maxcpus = NR_CPUS;
 #endif
 
+static DECLARE_COMPLETION(cpu_bringup_complete);
+
 void __init prefill_possible_map(void)
 {
 	int i, rc;
@@ -164,6 +166,7 @@
 void cpu_bringup(void)
 {
 	cpu_init();
+	complete(&cpu_bringup_complete);
 	preempt_disable();
 	local_irq_enable();
 }
@@ -455,6 +458,7 @@
 
 	rc = HYPERVISOR_vcpu_op(VCPUOP_up, cpu, NULL);
 	BUG_ON(rc);
+	wait_for_completion_interruptible(&cpu_bringup_complete);
 
 	return 0;
 }
