WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Fix x86_64 CPU hotplug by paravirtualizing the play_dead

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Fix x86_64 CPU hotplug by paravirtualizing the play_dead() function.
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 09 Feb 2006 11:16:08 +0000
Delivery-date: Thu, 09 Feb 2006 11:28:15 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Fix x86_64 CPU hotplug by paravirtualizing the play_dead() function., Xen patchbot -unstable <=