From: Chris Lalancette <clalance@redhat.com> Subject: Re: [RHEL5.1 PATCH]: Fix restore path for 5.1 PV guests Date: Mon, 06 Aug 2007 13:28:15 -0400 Bugzilla: 250420 Message-Id: <46B75A2F.8090204@redhat.com> Changelog: [Xen] Fix restore path for 5.1 PV guests Chris Lalancette wrote: >> >>This fixes BZ 250420, which should be getting a blocker flag. Please ACK. All, This is a repost of the same patch, minus the unused cpu_set_initialized bits that Steven Rostedt pointed out (some of the discussion happened only on virtualist, which is why this seems a little disconnected). Again, compile tested by me on i686 and x86_64, and tested to fix the issue for me on i686. I've also now sent a patch to upstream Xen to remove this unused macro in xen-unstable.hg (and I'm waiting to hear feedback). Please ACK. Chris Lalancette diff -urp /home/boston/clalance/cvs/redhat/kernel/RHEL-5/kernel-2.6.18/linux-2.6.18.noarch/drivers/xen/core/reboot.c linux-2.6.18.noarch/drivers/xen/core/reboot.c --- /home/boston/clalance/cvs/redhat/kernel/RHEL-5/kernel-2.6.18/linux-2.6.18.noarch/drivers/xen/core/reboot.c 2007-08-01 12:00:27.000000000 -0400 +++ linux-2.6.18.noarch/drivers/xen/core/reboot.c 2007-08-01 11:43:26.000000000 -0400 @@ -117,6 +117,10 @@ static void post_suspend(void) extern unsigned long *pfn_to_mfn_frame_list_list; extern unsigned long *pfn_to_mfn_frame_list[]; +#ifdef CONFIG_SMP + cpu_initialized_map = cpu_online_map; +#endif + set_fixmap(FIX_SHARED_INFO, xen_start_info->shared_info); HYPERVISOR_shared_info = (shared_info_t *)fix_to_virt(FIX_SHARED_INFO); diff -urp /home/boston/clalance/cvs/redhat/kernel/RHEL-5/kernel-2.6.18/linux-2.6.18.noarch/drivers/xen/core/smpboot.c linux-2.6.18.noarch/drivers/xen/core/smpboot.c --- /home/boston/clalance/cvs/redhat/kernel/RHEL-5/kernel-2.6.18/linux-2.6.18.noarch/drivers/xen/core/smpboot.c 2007-08-01 12:00:57.000000000 -0400 +++ linux-2.6.18.noarch/drivers/xen/core/smpboot.c 2007-08-01 11:37:23.000000000 -0400 @@ -252,6 +252,8 @@ void __init smp_prepare_cpus(unsigned in xen_smp_intr_init(0); + cpu_initialized_map = cpumask_of_cpu(0); + /* Restrict the possible_map according to max_cpus. */ while ((num_possible_cpus() > 1) && (num_possible_cpus() > max_cpus)) { for (cpu = NR_CPUS-1; !cpu_isset(cpu, cpu_possible_map); cpu--) @@ -304,8 +306,6 @@ void __init smp_prepare_cpus(unsigned in #else cpu_set(cpu, cpu_present_map); #endif - - cpu_initialize_context(cpu); } init_xenbus_allowed_cpumask(); diff -urp /home/boston/clalance/cvs/redhat/kernel/RHEL-5/kernel-2.6.18/linux-2.6.18.noarch/include/xen/cpu_hotplug.h linux-2.6.18.noarch/include/xen/cpu_hotplug.h --- /home/boston/clalance/cvs/redhat/kernel/RHEL-5/kernel-2.6.18/linux-2.6.18.noarch/include/xen/cpu_hotplug.h 2007-08-01 12:00:57.000000000 -0400 +++ linux-2.6.18.noarch/include/xen/cpu_hotplug.h 2007-08-01 11:39:25.000000000 -0400 @@ -4,6 +4,10 @@ #include <linux/kernel.h> #include <linux/cpumask.h> +#if defined(CONFIG_X86) && defined(CONFIG_SMP) +extern cpumask_t cpu_initialized_map; +#endif + #if defined(CONFIG_HOTPLUG_CPU) int cpu_up_check(unsigned int cpu);