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

[Xen-changelog] Rationalise initialisation of cpu_possible_map.



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID bc2ac5e87f99d3842f180321c4865b389d016c95
# Parent  dcc2beb8a1d23d6eb34fe19170d3c52b956a8ac0
Rationalise initialisation of cpu_possible_map.

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r dcc2beb8a1d2 -r bc2ac5e87f99 
linux-2.6-xen-sparse/drivers/xen/core/smpboot.c
--- a/linux-2.6-xen-sparse/drivers/xen/core/smpboot.c   Tue Feb  7 23:30:50 2006
+++ b/linux-2.6-xen-sparse/drivers/xen/core/smpboot.c   Wed Feb  8 10:10:52 2006
@@ -85,6 +85,9 @@
 {
        int i, rc;
 
+       if (!cpus_empty(cpu_possible_map))
+               return;
+
        for (i = 0; i < NR_CPUS; i++) {
                rc = HYPERVISOR_vcpu_op(VCPUOP_is_up, i, NULL);
                if (rc == -ENOENT)
@@ -208,7 +211,7 @@
 
 void __init smp_prepare_cpus(unsigned int max_cpus)
 {
-       int cpu, rc;
+       int cpu;
        struct task_struct *idle;
 
        cpu_data[0] = boot_cpu_data;
@@ -223,11 +226,9 @@
        if (max_cpus != 0)
                xen_smp_intr_init(0);
 
-       for (cpu = 1; cpu < max_cpus; cpu++) {
-               rc = HYPERVISOR_vcpu_op(VCPUOP_is_up, cpu, NULL);
-               if (rc == -ENOENT)
-                       break;
-               BUG_ON(rc != 0);
+       for_each_cpu_mask (cpu, cpu_possible_map) {
+               if (cpu == 0)
+                       continue;
 
                cpu_data[cpu] = boot_cpu_data;
                cpu_2_logical_apicid[cpu] = cpu;
@@ -257,7 +258,6 @@
                        (void *)cpu_gdt_descr[cpu].address,
                        XENFEAT_writable_descriptor_tables);
 
-               cpu_set(cpu, cpu_possible_map);
 #ifdef CONFIG_HOTPLUG_CPU
                if (xen_start_info->flags & SIF_INITDOMAIN)
                        cpu_set(cpu, cpu_present_map);
@@ -286,7 +286,7 @@
 
 void __devinit smp_prepare_boot_cpu(void)
 {
-       cpu_possible_map = cpumask_of_cpu(0);
+       prefill_possible_map();
        cpu_present_map  = cpumask_of_cpu(0);
        cpu_online_map   = cpumask_of_cpu(0);
 }

_______________________________________________
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®.