Skip to contentSkip to conversation

Populate cpu_enabled_map

PATCH In review Alex Chiang 1 participant 1 message Jul 15, 2008

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 10/14 Populate cpu_enabled_map

Populate the cpu_enabled_map correctly.

Note that this patch does not actually make any decisions based on the contents of the map.

However, as the map is presented via sysfs in:

/sys/devices/system/cpu/

It should be populated correctly.

Cc David S. Miller <[email protected]>

---

 arch/sparc/kernel/smp.c     |    1 +
 arch/sparc64/kernel/mdesc.c |    1 +
 arch/sparc64/kernel/smp.c   |    1 +
 3 files changed, 3 insertions(+), 0 deletions(-)
arch/sparc/kernel/smp.c +1 -0
index 6724ab9..154f32c 100644
@@ -343,6 +343,7 @@ void __init smp_setup_cpu_possible_map(void)
 		if (mid < NR_CPUS) {
 			cpu_set(mid, phys_cpu_present_map);
 			cpu_set(mid, cpu_present_map);
+			cpu_set(mid, cpu_enabled_map);
 		}
 		instance++;
 	}
arch/sparc64/kernel/mdesc.c +1 -0
index dde52bc..5a77dad 100644
@@ -827,6 +827,7 @@ void __cpuinit mdesc_fill_in_cpu_data(cpumask_t mask)
 
 #ifdef CONFIG_SMP
 		cpu_set(cpuid, cpu_present_map);
+		cpu_set(cpuid, cpu_enabled_map);
 #endif
 
 		c->core_id = 0;
arch/sparc64/kernel/smp.c +1 -0
index fa63c68..652992a 100644
@@ -1414,6 +1414,7 @@ void __cpu_die(unsigned int cpu)
 			hv_err = sun4v_cpu_stop(cpu);
 			if (hv_err == HV_EOK) {
 				cpu_clear(cpu, cpu_present_map);
+				cpu_clear(cpu, cpu_enabled_map);
 				break;
 			}
 		} while (--limit > 0);