diff --git a/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c b/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c index b403d1e004..c77cd2eadf 100644 --- a/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c +++ b/linux-2.6-xen-sparse/arch/xen/kernel/reboot.c @@ -182,12 +182,20 @@ static int __do_suspend(void *ignore) xencons_resume(); - xenbus_resume(); - #ifdef CONFIG_SMP for_each_cpu(i) vcpu_prepare(i); +#endif + + /* + ** Only resume xenbus /after/ we've prepared our VCPUs; otherwise + ** the VCPU hotplug callback can race with our vcpu_prepare + */ + xenbus_resume(); + + +#ifdef CONFIG_SMP out_reenable_cpus: for_each_cpu_mask(i, prev_online_cpus) { j = cpu_up(i);