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 blkif and netif backend teardown -- do not remove de

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Fix blkif and netif backend teardown -- do not remove devices from
From: Xen patchbot-3.0-testing <patchbot-3.0-testing@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 11 May 2006 09:38:25 +0000
Delivery-date: Thu, 11 May 2006 02:41:42 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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 651267a6933e08c726857db742aa0c4a4638bd1a
# Parent  83127ceb792f06a5b30547f342ff57a500d89c47
Set up and tear down phys_proc_id, cpu_core_id, cpu_sibling_map
and cpu_core_map when CPUs come online and go offline.

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
xen-unstable changeset:   9962:d8954fc3b76b6bdbe0cd301924b51dffa43409d1
xen-unstable date:        Wed May 10 15:44:56 2006 +0100
---
 linux-2.6-xen-sparse/drivers/xen/core/smpboot.c |   42 ++++++++++++++++++++++--
 1 files changed, 40 insertions(+), 2 deletions(-)

diff -r 83127ceb792f -r 651267a6933e 
linux-2.6-xen-sparse/drivers/xen/core/smpboot.c
--- a/linux-2.6-xen-sparse/drivers/xen/core/smpboot.c   Wed May 10 13:42:10 
2006 +0100
+++ b/linux-2.6-xen-sparse/drivers/xen/core/smpboot.c   Wed May 10 15:46:08 
2006 +0100
@@ -107,6 +107,18 @@ void __init smp_alloc_memory(void)
 {
 }
 
+static inline void
+set_cpu_sibling_map(int cpu)
+{
+       phys_proc_id[cpu] = cpu;
+       cpu_core_id[cpu]  = 0;
+
+       cpu_sibling_map[cpu] = cpumask_of_cpu(cpu);
+       cpu_core_map[cpu]    = cpumask_of_cpu(cpu);
+
+       cpu_data[cpu].booted_cores = 1;
+}
+
 static void xen_smp_intr_init(unsigned int cpu)
 {
        sprintf(resched_name[cpu], "resched%d", cpu);
@@ -230,14 +242,20 @@ void __init smp_prepare_cpus(unsigned in
        struct Xgt_desc_struct *gdt_descr;
 #endif
 
+       boot_cpu_data.apicid = 0;
        cpu_data[0] = boot_cpu_data;
 
        cpu_2_logical_apicid[0] = 0;
        x86_cpu_to_apicid[0] = 0;
 
        current_thread_info()->cpu = 0;
-       cpu_sibling_map[0] = cpumask_of_cpu(0);
-       cpu_core_map[0]    = cpumask_of_cpu(0);
+
+       for (cpu = 0; cpu < NR_CPUS; cpu++) {
+               cpus_clear(cpu_sibling_map[cpu]);
+               cpus_clear(cpu_core_map[cpu]);
+       }
+
+       set_cpu_sibling_map(0);
 
        xen_smp_intr_init(0);
 
@@ -262,6 +280,8 @@ void __init smp_prepare_cpus(unsigned in
                        XENFEAT_writable_descriptor_tables);
 
                cpu_data[cpu] = boot_cpu_data;
+               cpu_data[cpu].apicid = cpu;
+
                cpu_2_logical_apicid[cpu] = cpu;
                x86_cpu_to_apicid[cpu] = cpu;
 
@@ -470,6 +490,18 @@ void smp_resume(void)
                vcpu_hotplug(i);
 }
 
+static void
+remove_siblinginfo(int cpu)
+{
+       phys_proc_id[cpu] = BAD_APICID;
+       cpu_core_id[cpu]  = BAD_APICID;
+
+       cpus_clear(cpu_sibling_map[cpu]);
+       cpus_clear(cpu_core_map[cpu]);
+
+       cpu_data[cpu].booted_cores = 0;
+}
+
 int __cpu_disable(void)
 {
        cpumask_t map = cpu_online_map;
@@ -477,6 +509,8 @@ int __cpu_disable(void)
 
        if (cpu == 0)
                return -EBUSY;
+
+       remove_siblinginfo(cpu);
 
        cpu_clear(cpu, map);
        fixup_irqs(map);
@@ -549,6 +583,10 @@ int __devinit __cpu_up(unsigned int cpu)
                prepare_for_smp();
 #endif
 
+       /* This must be done before setting cpu_online_map */
+       set_cpu_sibling_map(cpu);
+       wmb();
+
        xen_smp_intr_init(cpu);
        cpu_set(cpu, cpu_online_map);
 

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

<Prev in Thread] Current Thread [Next in Thread>