[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Fix x86_64 CPU hotplug by paravirtualizing the play_dead() function.



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 99e7b8f9122e609ee0ced0c669be4f9c9c590091
# Parent  6789ae50ce7ff1c4755dc4768fdb6d9158a39c9e
Fix x86_64 CPU hotplug by paravirtualizing the play_dead() function.

Also fix the i386 play_dead() function to call idle_task_exit(),
which ensures the CPU exits while running the init_mm. Otherwise
other tasks may get stuck.

Signed-off-by: Ryan Grimm <grimm@xxxxxxxxxx>
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r 6789ae50ce7f -r 99e7b8f9122e buildconfigs/linux-defconfig_xenU_x86_64
--- a/buildconfigs/linux-defconfig_xenU_x86_64  Wed Feb  8 23:22:38 2006
+++ b/buildconfigs/linux-defconfig_xenU_x86_64  Wed Feb  8 23:27:52 2006
@@ -127,7 +127,7 @@
 # CONFIG_SPARSEMEM_STATIC is not set
 CONFIG_SPLIT_PTLOCK_CPUS=4096
 CONFIG_NR_CPUS=8
-# CONFIG_HOTPLUG_CPU is not set
+CONFIG_HOTPLUG_CPU=y
 CONFIG_SWIOTLB=y
 # CONFIG_CRASH_DUMP is not set
 CONFIG_PHYSICAL_START=0x100000
diff -r 6789ae50ce7f -r 99e7b8f9122e buildconfigs/linux-defconfig_xen_x86_64
--- a/buildconfigs/linux-defconfig_xen_x86_64   Wed Feb  8 23:22:38 2006
+++ b/buildconfigs/linux-defconfig_xen_x86_64   Wed Feb  8 23:27:52 2006
@@ -130,7 +130,7 @@
 # CONFIG_SPARSEMEM_STATIC is not set
 CONFIG_SPLIT_PTLOCK_CPUS=4096
 CONFIG_NR_CPUS=8
-# CONFIG_HOTPLUG_CPU is not set
+CONFIG_HOTPLUG_CPU=y
 CONFIG_SWIOTLB=y
 # CONFIG_CRASH_DUMP is not set
 CONFIG_PHYSICAL_START=0x100000
diff -r 6789ae50ce7f -r 99e7b8f9122e 
linux-2.6-xen-sparse/arch/i386/kernel/process-xen.c
--- a/linux-2.6-xen-sparse/arch/i386/kernel/process-xen.c       Wed Feb  8 
23:22:38 2006
+++ b/linux-2.6-xen-sparse/arch/i386/kernel/process-xen.c       Wed Feb  8 
23:27:52 2006
@@ -126,6 +126,7 @@
 #ifdef CONFIG_HOTPLUG_CPU
 static inline void play_dead(void)
 {
+       idle_task_exit();
        HYPERVISOR_vcpu_op(VCPUOP_down, smp_processor_id(), NULL);
        local_irq_enable();
 }
diff -r 6789ae50ce7f -r 99e7b8f9122e 
linux-2.6-xen-sparse/arch/x86_64/kernel/process-xen.c
--- a/linux-2.6-xen-sparse/arch/x86_64/kernel/process-xen.c     Wed Feb  8 
23:22:38 2006
+++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/process-xen.c     Wed Feb  8 
23:27:52 2006
@@ -53,6 +53,7 @@
 #include <asm/kdebug.h>
 #include <xen/interface/dom0_ops.h>
 #include <xen/interface/physdev.h>
+#include <xen/interface/vcpu.h>
 #include <asm/desc.h>
 #include <asm/proto.h>
 #include <asm/hardirq.h>
@@ -144,21 +145,7 @@
 static inline void play_dead(void)
 {
        idle_task_exit();
-       wbinvd();
-       mb();
-       /* Ack it */
-       __get_cpu_var(cpu_state) = CPU_DEAD;
-
-       /* We shouldn't have to disable interrupts while dead, but
-        * some interrupts just don't seem to go away, and this makes
-        * it "work" for testing purposes. */
-       /* Death loop */
-       while (__get_cpu_var(cpu_state) != CPU_UP_PREPARE)
-               HYPERVISOR_sched_op(SCHEDOP_yield, 0);
-
-       local_irq_disable();
-       __flush_tlb_all();
-       cpu_set(smp_processor_id(), cpu_online_map);
+       HYPERVISOR_vcpu_op(VCPUOP_down, smp_processor_id(), NULL);
        local_irq_enable();
 }
 #else

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.