diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2008-12-13 05:49:41 -0500 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2008-12-13 05:49:41 -0500 |
commit | 98a79d6a50181ca1ecf7400eda01d5dc1bc0dbf0 (patch) | |
tree | e8829ee975b77745da153b9d23601e3a1497ad68 | |
parent | 6c34bc2976b30dc8b56392c020e25bae1f363cab (diff) |
cpumask: centralize cpu_online_map and cpu_possible_map
Impact: cleanup
Each SMP arch defines these themselves. Move them to a central
location.
Twists:
1) Some archs (m32, parisc, s390) set possible_map to all 1, so we add a
CONFIG_INIT_ALL_POSSIBLE for this rather than break them.
2) mips and sparc32 '#define cpu_possible_map phys_cpu_present_map'.
Those archs simply have phys_cpu_present_map replaced everywhere.
3) Alpha defined cpu_possible_map to cpu_present_map; this is tricky
so I just manipulate them both in sync.
4) IA64, cris and m32r have gratuitous 'extern cpumask_t cpu_possible_map'
declarations.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Reviewed-by: Grant Grundler <grundler@parisc-linux.org>
Tested-by: Tony Luck <tony.luck@intel.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Cc: Mike Travis <travis@sgi.com>
Cc: ink@jurassic.park.msu.ru
Cc: rmk@arm.linux.org.uk
Cc: starvik@axis.com
Cc: tony.luck@intel.com
Cc: takata@linux-m32r.org
Cc: ralf@linux-mips.org
Cc: grundler@parisc-linux.org
Cc: paulus@samba.org
Cc: schwidefsky@de.ibm.com
Cc: lethal@linux-sh.org
Cc: wli@holomorphy.com
Cc: davem@davemloft.net
Cc: jdike@addtoit.com
Cc: mingo@redhat.com
35 files changed, 42 insertions, 132 deletions
diff --git a/arch/alpha/include/asm/smp.h b/arch/alpha/include/asm/smp.h index 544c69af8168..547e90951cec 100644 --- a/arch/alpha/include/asm/smp.h +++ b/arch/alpha/include/asm/smp.h | |||
@@ -45,7 +45,6 @@ extern struct cpuinfo_alpha cpu_data[NR_CPUS]; | |||
45 | #define raw_smp_processor_id() (current_thread_info()->cpu) | 45 | #define raw_smp_processor_id() (current_thread_info()->cpu) |
46 | 46 | ||
47 | extern int smp_num_cpus; | 47 | extern int smp_num_cpus; |
48 | #define cpu_possible_map cpu_present_map | ||
49 | 48 | ||
50 | extern void arch_send_call_function_single_ipi(int cpu); | 49 | extern void arch_send_call_function_single_ipi(int cpu); |
51 | extern void arch_send_call_function_ipi(cpumask_t mask); | 50 | extern void arch_send_call_function_ipi(cpumask_t mask); |
diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c index 351407e07e71..f238370c907d 100644 --- a/arch/alpha/kernel/process.c +++ b/arch/alpha/kernel/process.c | |||
@@ -94,6 +94,7 @@ common_shutdown_1(void *generic_ptr) | |||
94 | flags |= 0x00040000UL; /* "remain halted" */ | 94 | flags |= 0x00040000UL; /* "remain halted" */ |
95 | *pflags = flags; | 95 | *pflags = flags; |
96 | cpu_clear(cpuid, cpu_present_map); | 96 | cpu_clear(cpuid, cpu_present_map); |
97 | cpu_clear(cpuid, cpu_possible_map); | ||
97 | halt(); | 98 | halt(); |
98 | } | 99 | } |
99 | #endif | 100 | #endif |
@@ -120,6 +121,7 @@ common_shutdown_1(void *generic_ptr) | |||
120 | #ifdef CONFIG_SMP | 121 | #ifdef CONFIG_SMP |
121 | /* Wait for the secondaries to halt. */ | 122 | /* Wait for the secondaries to halt. */ |
122 | cpu_clear(boot_cpuid, cpu_present_map); | 123 | cpu_clear(boot_cpuid, cpu_present_map); |
124 | cpu_clear(boot_cpuid, cpu_possible_map); | ||
123 | while (cpus_weight(cpu_present_map)) | 125 | while (cpus_weight(cpu_present_map)) |
124 | barrier(); | 126 | barrier(); |
125 | #endif | 127 | #endif |
diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c index cf7da10097bb..d953e510f68d 100644 --- a/arch/alpha/kernel/smp.c +++ b/arch/alpha/kernel/smp.c | |||
@@ -70,11 +70,6 @@ enum ipi_message_type { | |||
70 | /* Set to a secondary's cpuid when it comes online. */ | 70 | /* Set to a secondary's cpuid when it comes online. */ |
71 | static int smp_secondary_alive __devinitdata = 0; | 71 | static int smp_secondary_alive __devinitdata = 0; |
72 | 72 | ||
73 | /* Which cpus ids came online. */ | ||
74 | cpumask_t cpu_online_map; | ||
75 | |||
76 | EXPORT_SYMBOL(cpu_online_map); | ||
77 | |||
78 | int smp_num_probed; /* Internal processor count */ | 73 | int smp_num_probed; /* Internal processor count */ |
79 | int smp_num_cpus = 1; /* Number that came online. */ | 74 | int smp_num_cpus = 1; /* Number that came online. */ |
80 | EXPORT_SYMBOL(smp_num_cpus); | 75 | EXPORT_SYMBOL(smp_num_cpus); |
@@ -440,6 +435,7 @@ setup_smp(void) | |||
440 | ((char *)cpubase + i*hwrpb->processor_size); | 435 | ((char *)cpubase + i*hwrpb->processor_size); |
441 | if ((cpu->flags & 0x1cc) == 0x1cc) { | 436 | if ((cpu->flags & 0x1cc) == 0x1cc) { |
442 | smp_num_probed++; | 437 | smp_num_probed++; |
438 | cpu_set(i, cpu_possible_map); | ||
443 | cpu_set(i, cpu_present_map); | 439 | cpu_set(i, cpu_present_map); |
444 | cpu->pal_revision = boot_cpu_palrev; | 440 | cpu->pal_revision = boot_cpu_palrev; |
445 | } | 441 | } |
@@ -473,6 +469,7 @@ smp_prepare_cpus(unsigned int max_cpus) | |||
473 | 469 | ||
474 | /* Nothing to do on a UP box, or when told not to. */ | 470 | /* Nothing to do on a UP box, or when told not to. */ |
475 | if (smp_num_probed == 1 || max_cpus == 0) { | 471 | if (smp_num_probed == 1 || max_cpus == 0) { |
472 | cpu_possible_map = cpumask_of_cpu(boot_cpuid); | ||
476 | cpu_present_map = cpumask_of_cpu(boot_cpuid); | 473 | cpu_present_map = cpumask_of_cpu(boot_cpuid); |
477 | printk(KERN_INFO "SMP mode deactivated.\n"); | 474 | printk(KERN_INFO "SMP mode deactivated.\n"); |
478 | return; | 475 | return; |
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index e42a749a56dd..bd905c0a7365 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c | |||
@@ -34,16 +34,6 @@ | |||
34 | #include <asm/ptrace.h> | 34 | #include <asm/ptrace.h> |
35 | 35 | ||
36 | /* | 36 | /* |
37 | * bitmask of present and online CPUs. | ||
38 | * The present bitmask indicates that the CPU is physically present. | ||
39 | * The online bitmask indicates that the CPU is up and running. | ||
40 | */ | ||
41 | cpumask_t cpu_possible_map; | ||
42 | EXPORT_SYMBOL(cpu_possible_map); | ||
43 | cpumask_t cpu_online_map; | ||
44 | EXPORT_SYMBOL(cpu_online_map); | ||
45 | |||
46 | /* | ||
47 | * as from 2.5, kernels no longer have an init_tasks structure | 37 | * as from 2.5, kernels no longer have an init_tasks structure |
48 | * so we need some other way of telling a new secondary core | 38 | * so we need some other way of telling a new secondary core |
49 | * where to place its SVC stack | 39 | * where to place its SVC stack |
diff --git a/arch/cris/arch-v32/kernel/smp.c b/arch/cris/arch-v32/kernel/smp.c index 52e16c6436f9..9dac17334640 100644 --- a/arch/cris/arch-v32/kernel/smp.c +++ b/arch/cris/arch-v32/kernel/smp.c | |||
@@ -29,11 +29,7 @@ | |||
29 | spinlock_t cris_atomic_locks[] = { [0 ... LOCK_COUNT - 1] = SPIN_LOCK_UNLOCKED}; | 29 | spinlock_t cris_atomic_locks[] = { [0 ... LOCK_COUNT - 1] = SPIN_LOCK_UNLOCKED}; |
30 | 30 | ||
31 | /* CPU masks */ | 31 | /* CPU masks */ |
32 | cpumask_t cpu_online_map = CPU_MASK_NONE; | ||
33 | EXPORT_SYMBOL(cpu_online_map); | ||
34 | cpumask_t phys_cpu_present_map = CPU_MASK_NONE; | 32 | cpumask_t phys_cpu_present_map = CPU_MASK_NONE; |
35 | cpumask_t cpu_possible_map; | ||
36 | EXPORT_SYMBOL(cpu_possible_map); | ||
37 | EXPORT_SYMBOL(phys_cpu_present_map); | 33 | EXPORT_SYMBOL(phys_cpu_present_map); |
38 | 34 | ||
39 | /* Variables used during SMP boot */ | 35 | /* Variables used during SMP boot */ |
diff --git a/arch/cris/include/asm/smp.h b/arch/cris/include/asm/smp.h index dba33aba3e95..c615a06dd757 100644 --- a/arch/cris/include/asm/smp.h +++ b/arch/cris/include/asm/smp.h | |||
@@ -4,7 +4,6 @@ | |||
4 | #include <linux/cpumask.h> | 4 | #include <linux/cpumask.h> |
5 | 5 | ||
6 | extern cpumask_t phys_cpu_present_map; | 6 | extern cpumask_t phys_cpu_present_map; |
7 | extern cpumask_t cpu_possible_map; | ||
8 | 7 | ||
9 | #define raw_smp_processor_id() (current_thread_info()->cpu) | 8 | #define raw_smp_processor_id() (current_thread_info()->cpu) |
10 | 9 | ||
diff --git a/arch/ia64/include/asm/smp.h b/arch/ia64/include/asm/smp.h index 12d96e0cd513..21c402365d0e 100644 --- a/arch/ia64/include/asm/smp.h +++ b/arch/ia64/include/asm/smp.h | |||
@@ -57,7 +57,6 @@ extern struct smp_boot_data { | |||
57 | 57 | ||
58 | extern char no_int_routing __devinitdata; | 58 | extern char no_int_routing __devinitdata; |
59 | 59 | ||
60 | extern cpumask_t cpu_online_map; | ||
61 | extern cpumask_t cpu_core_map[NR_CPUS]; | 60 | extern cpumask_t cpu_core_map[NR_CPUS]; |
62 | DECLARE_PER_CPU(cpumask_t, cpu_sibling_map); | 61 | DECLARE_PER_CPU(cpumask_t, cpu_sibling_map); |
63 | extern int smp_num_siblings; | 62 | extern int smp_num_siblings; |
diff --git a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c index 1dcbb85fc4ee..4ede6e571c38 100644 --- a/arch/ia64/kernel/smpboot.c +++ b/arch/ia64/kernel/smpboot.c | |||
@@ -131,12 +131,6 @@ struct task_struct *task_for_booting_cpu; | |||
131 | */ | 131 | */ |
132 | DEFINE_PER_CPU(int, cpu_state); | 132 | DEFINE_PER_CPU(int, cpu_state); |
133 | 133 | ||
134 | /* Bitmasks of currently online, and possible CPUs */ | ||
135 | cpumask_t cpu_online_map; | ||
136 | EXPORT_SYMBOL(cpu_online_map); | ||
137 | cpumask_t cpu_possible_map = CPU_MASK_NONE; | ||
138 | EXPORT_SYMBOL(cpu_possible_map); | ||
139 | |||
140 | cpumask_t cpu_core_map[NR_CPUS] __cacheline_aligned; | 134 | cpumask_t cpu_core_map[NR_CPUS] __cacheline_aligned; |
141 | EXPORT_SYMBOL(cpu_core_map); | 135 | EXPORT_SYMBOL(cpu_core_map); |
142 | DEFINE_PER_CPU_SHARED_ALIGNED(cpumask_t, cpu_sibling_map); | 136 | DEFINE_PER_CPU_SHARED_ALIGNED(cpumask_t, cpu_sibling_map); |
diff --git a/arch/m32r/Kconfig b/arch/m32r/Kconfig index dbaed4a63815..17a6dab09319 100644 --- a/arch/m32r/Kconfig +++ b/arch/m32r/Kconfig | |||
@@ -10,6 +10,7 @@ config M32R | |||
10 | default y | 10 | default y |
11 | select HAVE_IDE | 11 | select HAVE_IDE |
12 | select HAVE_OPROFILE | 12 | select HAVE_OPROFILE |
13 | select INIT_ALL_POSSIBLE | ||
13 | 14 | ||
14 | config SBUS | 15 | config SBUS |
15 | bool | 16 | bool |
diff --git a/arch/m32r/kernel/smpboot.c b/arch/m32r/kernel/smpboot.c index 39cb6da72dcb..0f06b3722e96 100644 --- a/arch/m32r/kernel/smpboot.c +++ b/arch/m32r/kernel/smpboot.c | |||
@@ -73,17 +73,11 @@ static unsigned int bsp_phys_id = -1; | |||
73 | /* Bitmask of physically existing CPUs */ | 73 | /* Bitmask of physically existing CPUs */ |
74 | physid_mask_t phys_cpu_present_map; | 74 | physid_mask_t phys_cpu_present_map; |
75 | 75 | ||
76 | /* Bitmask of currently online CPUs */ | ||
77 | cpumask_t cpu_online_map; | ||
78 | EXPORT_SYMBOL(cpu_online_map); | ||
79 | |||
80 | cpumask_t cpu_bootout_map; | 76 | cpumask_t cpu_bootout_map; |
81 | cpumask_t cpu_bootin_map; | 77 | cpumask_t cpu_bootin_map; |
82 | static cpumask_t cpu_callin_map; | 78 | static cpumask_t cpu_callin_map; |
83 | cpumask_t cpu_callout_map; | 79 | cpumask_t cpu_callout_map; |
84 | EXPORT_SYMBOL(cpu_callout_map); | 80 | EXPORT_SYMBOL(cpu_callout_map); |
85 | cpumask_t cpu_possible_map = CPU_MASK_ALL; | ||
86 | EXPORT_SYMBOL(cpu_possible_map); | ||
87 | 81 | ||
88 | /* Per CPU bogomips and other parameters */ | 82 | /* Per CPU bogomips and other parameters */ |
89 | struct cpuinfo_m32r cpu_data[NR_CPUS] __cacheline_aligned; | 83 | struct cpuinfo_m32r cpu_data[NR_CPUS] __cacheline_aligned; |
diff --git a/arch/mips/include/asm/smp.h b/arch/mips/include/asm/smp.h index 0ff5b523ea77..86557b5d1b3f 100644 --- a/arch/mips/include/asm/smp.h +++ b/arch/mips/include/asm/smp.h | |||
@@ -38,9 +38,6 @@ extern int __cpu_logical_map[NR_CPUS]; | |||
38 | #define SMP_RESCHEDULE_YOURSELF 0x1 /* XXX braindead */ | 38 | #define SMP_RESCHEDULE_YOURSELF 0x1 /* XXX braindead */ |
39 | #define SMP_CALL_FUNCTION 0x2 | 39 | #define SMP_CALL_FUNCTION 0x2 |
40 | 40 | ||
41 | extern cpumask_t phys_cpu_present_map; | ||
42 | #define cpu_possible_map phys_cpu_present_map | ||
43 | |||
44 | extern void asmlinkage smp_bootstrap(void); | 41 | extern void asmlinkage smp_bootstrap(void); |
45 | 42 | ||
46 | /* | 43 | /* |
diff --git a/arch/mips/kernel/smp-cmp.c b/arch/mips/kernel/smp-cmp.c index ca476c4f62a5..6789c1a12120 100644 --- a/arch/mips/kernel/smp-cmp.c +++ b/arch/mips/kernel/smp-cmp.c | |||
@@ -226,7 +226,7 @@ void __init cmp_smp_setup(void) | |||
226 | 226 | ||
227 | for (i = 1; i < NR_CPUS; i++) { | 227 | for (i = 1; i < NR_CPUS; i++) { |
228 | if (amon_cpu_avail(i)) { | 228 | if (amon_cpu_avail(i)) { |
229 | cpu_set(i, phys_cpu_present_map); | 229 | cpu_set(i, cpu_possible_map); |
230 | __cpu_number_map[i] = ++ncpu; | 230 | __cpu_number_map[i] = ++ncpu; |
231 | __cpu_logical_map[ncpu] = i; | 231 | __cpu_logical_map[ncpu] = i; |
232 | } | 232 | } |
diff --git a/arch/mips/kernel/smp-mt.c b/arch/mips/kernel/smp-mt.c index 87a1816c1f45..6f7ee5ac46ee 100644 --- a/arch/mips/kernel/smp-mt.c +++ b/arch/mips/kernel/smp-mt.c | |||
@@ -70,7 +70,7 @@ static unsigned int __init smvp_vpe_init(unsigned int tc, unsigned int mvpconf0, | |||
70 | write_vpe_c0_vpeconf0(tmp); | 70 | write_vpe_c0_vpeconf0(tmp); |
71 | 71 | ||
72 | /* Record this as available CPU */ | 72 | /* Record this as available CPU */ |
73 | cpu_set(tc, phys_cpu_present_map); | 73 | cpu_set(tc, cpu_possible_map); |
74 | __cpu_number_map[tc] = ++ncpu; | 74 | __cpu_number_map[tc] = ++ncpu; |
75 | __cpu_logical_map[ncpu] = tc; | 75 | __cpu_logical_map[ncpu] = tc; |
76 | } | 76 | } |
diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c index 8bf88faf5afd..3da94704f816 100644 --- a/arch/mips/kernel/smp.c +++ b/arch/mips/kernel/smp.c | |||
@@ -44,15 +44,10 @@ | |||
44 | #include <asm/mipsmtregs.h> | 44 | #include <asm/mipsmtregs.h> |
45 | #endif /* CONFIG_MIPS_MT_SMTC */ | 45 | #endif /* CONFIG_MIPS_MT_SMTC */ |
46 | 46 | ||
47 | cpumask_t phys_cpu_present_map; /* Bitmask of available CPUs */ | ||
48 | volatile cpumask_t cpu_callin_map; /* Bitmask of started secondaries */ | 47 | volatile cpumask_t cpu_callin_map; /* Bitmask of started secondaries */ |
49 | cpumask_t cpu_online_map; /* Bitmask of currently online CPUs */ | ||
50 | int __cpu_number_map[NR_CPUS]; /* Map physical to logical */ | 48 | int __cpu_number_map[NR_CPUS]; /* Map physical to logical */ |
51 | int __cpu_logical_map[NR_CPUS]; /* Map logical to physical */ | 49 | int __cpu_logical_map[NR_CPUS]; /* Map logical to physical */ |
52 | 50 | ||
53 | EXPORT_SYMBOL(phys_cpu_present_map); | ||
54 | EXPORT_SYMBOL(cpu_online_map); | ||
55 | |||
56 | extern void cpu_idle(void); | 51 | extern void cpu_idle(void); |
57 | 52 | ||
58 | /* Number of TCs (or siblings in Intel speak) per CPU core */ | 53 | /* Number of TCs (or siblings in Intel speak) per CPU core */ |
@@ -195,7 +190,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
195 | /* preload SMP state for boot cpu */ | 190 | /* preload SMP state for boot cpu */ |
196 | void __devinit smp_prepare_boot_cpu(void) | 191 | void __devinit smp_prepare_boot_cpu(void) |
197 | { | 192 | { |
198 | cpu_set(0, phys_cpu_present_map); | 193 | cpu_set(0, cpu_possible_map); |
199 | cpu_set(0, cpu_online_map); | 194 | cpu_set(0, cpu_online_map); |
200 | cpu_set(0, cpu_callin_map); | 195 | cpu_set(0, cpu_callin_map); |
201 | } | 196 | } |
diff --git a/arch/mips/kernel/smtc.c b/arch/mips/kernel/smtc.c index 897fb2b4751c..b6cca01ff82b 100644 --- a/arch/mips/kernel/smtc.c +++ b/arch/mips/kernel/smtc.c | |||
@@ -290,7 +290,7 @@ static void smtc_configure_tlb(void) | |||
290 | * possibly leave some TCs/VPEs as "slave" processors. | 290 | * possibly leave some TCs/VPEs as "slave" processors. |
291 | * | 291 | * |
292 | * Use c0_MVPConf0 to find out how many TCs are available, setting up | 292 | * Use c0_MVPConf0 to find out how many TCs are available, setting up |
293 | * phys_cpu_present_map and the logical/physical mappings. | 293 | * cpu_possible_map and the logical/physical mappings. |
294 | */ | 294 | */ |
295 | 295 | ||
296 | int __init smtc_build_cpu_map(int start_cpu_slot) | 296 | int __init smtc_build_cpu_map(int start_cpu_slot) |
@@ -304,7 +304,7 @@ int __init smtc_build_cpu_map(int start_cpu_slot) | |||
304 | */ | 304 | */ |
305 | ntcs = ((read_c0_mvpconf0() & MVPCONF0_PTC) >> MVPCONF0_PTC_SHIFT) + 1; | 305 | ntcs = ((read_c0_mvpconf0() & MVPCONF0_PTC) >> MVPCONF0_PTC_SHIFT) + 1; |
306 | for (i=start_cpu_slot; i<NR_CPUS && i<ntcs; i++) { | 306 | for (i=start_cpu_slot; i<NR_CPUS && i<ntcs; i++) { |
307 | cpu_set(i, phys_cpu_present_map); | 307 | cpu_set(i, cpu_possible_map); |
308 | __cpu_number_map[i] = i; | 308 | __cpu_number_map[i] = i; |
309 | __cpu_logical_map[i] = i; | 309 | __cpu_logical_map[i] = i; |
310 | } | 310 | } |
@@ -521,7 +521,7 @@ void smtc_prepare_cpus(int cpus) | |||
521 | * Pull any physically present but unused TCs out of circulation. | 521 | * Pull any physically present but unused TCs out of circulation. |
522 | */ | 522 | */ |
523 | while (tc < (((val & MVPCONF0_PTC) >> MVPCONF0_PTC_SHIFT) + 1)) { | 523 | while (tc < (((val & MVPCONF0_PTC) >> MVPCONF0_PTC_SHIFT) + 1)) { |
524 | cpu_clear(tc, phys_cpu_present_map); | 524 | cpu_clear(tc, cpu_possible_map); |
525 | cpu_clear(tc, cpu_present_map); | 525 | cpu_clear(tc, cpu_present_map); |
526 | tc++; | 526 | tc++; |
527 | } | 527 | } |
diff --git a/arch/mips/pmc-sierra/yosemite/smp.c b/arch/mips/pmc-sierra/yosemite/smp.c index 3a7df647ca77..f78c29b68d77 100644 --- a/arch/mips/pmc-sierra/yosemite/smp.c +++ b/arch/mips/pmc-sierra/yosemite/smp.c | |||
@@ -141,7 +141,7 @@ static void __cpuinit yos_boot_secondary(int cpu, struct task_struct *idle) | |||
141 | } | 141 | } |
142 | 142 | ||
143 | /* | 143 | /* |
144 | * Detect available CPUs, populate phys_cpu_present_map before smp_init | 144 | * Detect available CPUs, populate cpu_possible_map before smp_init |
145 | * | 145 | * |
146 | * We don't want to start the secondary CPU yet nor do we have a nice probing | 146 | * We don't want to start the secondary CPU yet nor do we have a nice probing |
147 | * feature in PMON so we just assume presence of the secondary core. | 147 | * feature in PMON so we just assume presence of the secondary core. |
@@ -150,10 +150,10 @@ static void __init yos_smp_setup(void) | |||
150 | { | 150 | { |
151 | int i; | 151 | int i; |
152 | 152 | ||
153 | cpus_clear(phys_cpu_present_map); | 153 | cpus_clear(cpu_possible_map); |
154 | 154 | ||
155 | for (i = 0; i < 2; i++) { | 155 | for (i = 0; i < 2; i++) { |
156 | cpu_set(i, phys_cpu_present_map); | 156 | cpu_set(i, cpu_possible_map); |
157 | __cpu_number_map[i] = i; | 157 | __cpu_number_map[i] = i; |
158 | __cpu_logical_map[i] = i; | 158 | __cpu_logical_map[i] = i; |
159 | } | 159 | } |
diff --git a/arch/mips/sgi-ip27/ip27-smp.c b/arch/mips/sgi-ip27/ip27-smp.c index ba5cdebeaf0d..5b47d6b65275 100644 --- a/arch/mips/sgi-ip27/ip27-smp.c +++ b/arch/mips/sgi-ip27/ip27-smp.c | |||
@@ -76,7 +76,7 @@ static int do_cpumask(cnodeid_t cnode, nasid_t nasid, int highest) | |||
76 | /* Only let it join in if it's marked enabled */ | 76 | /* Only let it join in if it's marked enabled */ |
77 | if ((acpu->cpu_info.flags & KLINFO_ENABLE) && | 77 | if ((acpu->cpu_info.flags & KLINFO_ENABLE) && |
78 | (tot_cpus_found != NR_CPUS)) { | 78 | (tot_cpus_found != NR_CPUS)) { |
79 | cpu_set(cpuid, phys_cpu_present_map); | 79 | cpu_set(cpuid, cpu_possible_map); |
80 | alloc_cpupda(cpuid, tot_cpus_found); | 80 | alloc_cpupda(cpuid, tot_cpus_found); |
81 | cpus_found++; | 81 | cpus_found++; |
82 | tot_cpus_found++; | 82 | tot_cpus_found++; |
diff --git a/arch/mips/sibyte/bcm1480/smp.c b/arch/mips/sibyte/bcm1480/smp.c index bd9eeb43ed0e..dddfda8e8294 100644 --- a/arch/mips/sibyte/bcm1480/smp.c +++ b/arch/mips/sibyte/bcm1480/smp.c | |||
@@ -136,7 +136,7 @@ static void __cpuinit bcm1480_boot_secondary(int cpu, struct task_struct *idle) | |||
136 | 136 | ||
137 | /* | 137 | /* |
138 | * Use CFE to find out how many CPUs are available, setting up | 138 | * Use CFE to find out how many CPUs are available, setting up |
139 | * phys_cpu_present_map and the logical/physical mappings. | 139 | * cpu_possible_map and the logical/physical mappings. |
140 | * XXXKW will the boot CPU ever not be physical 0? | 140 | * XXXKW will the boot CPU ever not be physical 0? |
141 | * | 141 | * |
142 | * Common setup before any secondaries are started | 142 | * Common setup before any secondaries are started |
@@ -145,14 +145,14 @@ static void __init bcm1480_smp_setup(void) | |||
145 | { | 145 | { |
146 | int i, num; | 146 | int i, num; |
147 | 147 | ||
148 | cpus_clear(phys_cpu_present_map); | 148 | cpus_clear(cpu_possible_map); |
149 | cpu_set(0, phys_cpu_present_map); | 149 | cpu_set(0, cpu_possible_map); |
150 | __cpu_number_map[0] = 0; | 150 | __cpu_number_map[0] = 0; |
151 | __cpu_logical_map[0] = 0; | 151 | __cpu_logical_map[0] = 0; |
152 | 152 | ||
153 | for (i = 1, num = 0; i < NR_CPUS; i++) { | 153 | for (i = 1, num = 0; i < NR_CPUS; i++) { |
154 | if (cfe_cpu_stop(i) == 0) { | 154 | if (cfe_cpu_stop(i) == 0) { |
155 | cpu_set(i, phys_cpu_present_map); | 155 | cpu_set(i, cpu_possible_map); |
156 | __cpu_number_map[i] = ++num; | 156 | __cpu_number_map[i] = ++num; |
157 | __cpu_logical_map[num] = i; | 157 | __cpu_logical_map[num] = i; |
158 | } | 158 | } |
diff --git a/arch/mips/sibyte/sb1250/smp.c b/arch/mips/sibyte/sb1250/smp.c index 0734b933e969..5950a288a7da 100644 --- a/arch/mips/sibyte/sb1250/smp.c +++ b/arch/mips/sibyte/sb1250/smp.c | |||
@@ -124,7 +124,7 @@ static void __cpuinit sb1250_boot_secondary(int cpu, struct task_struct *idle) | |||
124 | 124 | ||
125 | /* | 125 | /* |
126 | * Use CFE to find out how many CPUs are available, setting up | 126 | * Use CFE to find out how many CPUs are available, setting up |
127 | * phys_cpu_present_map and the logical/physical mappings. | 127 | * cpu_possible_map and the logical/physical mappings. |
128 | * XXXKW will the boot CPU ever not be physical 0? | 128 | * XXXKW will the boot CPU ever not be physical 0? |
129 | * | 129 | * |
130 | * Common setup before any secondaries are started | 130 | * Common setup before any secondaries are started |
@@ -133,14 +133,14 @@ static void __init sb1250_smp_setup(void) | |||
133 | { | 133 | { |
134 | int i, num; | 134 | int i, num; |
135 | 135 | ||
136 | cpus_clear(phys_cpu_present_map); | 136 | cpus_clear(cpu_possible_map); |
137 | cpu_set(0, phys_cpu_present_map); | 137 | cpu_set(0, cpu_possible_map); |
138 | __cpu_number_map[0] = 0; | 138 | __cpu_number_map[0] = 0; |
139 | __cpu_logical_map[0] = 0; | 139 | __cpu_logical_map[0] = 0; |
140 | 140 | ||
141 | for (i = 1, num = 0; i < NR_CPUS; i++) { | 141 | for (i = 1, num = 0; i < NR_CPUS; i++) { |
142 | if (cfe_cpu_stop(i) == 0) { | 142 | if (cfe_cpu_stop(i) == 0) { |
143 | cpu_set(i, phys_cpu_present_map); | 143 | cpu_set(i, cpu_possible_map); |
144 | __cpu_number_map[i] = ++num; | 144 | __cpu_number_map[i] = ++num; |
145 | __cpu_logical_map[num] = i; | 145 | __cpu_logical_map[num] = i; |
146 | } | 146 | } |
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig index 644a70b1b04e..aacf11d33723 100644 --- a/arch/parisc/Kconfig +++ b/arch/parisc/Kconfig | |||
@@ -11,6 +11,7 @@ config PARISC | |||
11 | select HAVE_OPROFILE | 11 | select HAVE_OPROFILE |
12 | select RTC_CLASS | 12 | select RTC_CLASS |
13 | select RTC_DRV_PARISC | 13 | select RTC_DRV_PARISC |
14 | select INIT_ALL_POSSIBLE | ||
14 | help | 15 | help |
15 | The PA-RISC microprocessor is designed by Hewlett-Packard and used | 16 | The PA-RISC microprocessor is designed by Hewlett-Packard and used |
16 | in many of their workstations & servers (HP9000 700 and 800 series, | 17 | in many of their workstations & servers (HP9000 700 and 800 series, |
diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c index d47f3975c9c6..80bc000523fa 100644 --- a/arch/parisc/kernel/smp.c +++ b/arch/parisc/kernel/smp.c | |||
@@ -67,21 +67,6 @@ static volatile int cpu_now_booting __read_mostly = 0; /* track which CPU is boo | |||
67 | 67 | ||
68 | static int parisc_max_cpus __read_mostly = 1; | 68 | static int parisc_max_cpus __read_mostly = 1; |
69 | 69 | ||
70 | /* online cpus are ones that we've managed to bring up completely | ||
71 | * possible cpus are all valid cpu | ||
72 | * present cpus are all detected cpu | ||
73 | * | ||
74 | * On startup we bring up the "possible" cpus. Since we discover | ||
75 | * CPUs later, we add them as hotplug, so the possible cpu mask is | ||
76 | * empty in the beginning. | ||
77 | */ | ||
78 | |||
79 | cpumask_t cpu_online_map __read_mostly = CPU_MASK_NONE; /* Bitmap of online CPUs */ | ||
80 | cpumask_t cpu_possible_map __read_mostly = CPU_MASK_ALL; /* Bitmap of Present CPUs */ | ||
81 | |||
82 | EXPORT_SYMBOL(cpu_online_map); | ||
83 | EXPORT_SYMBOL(cpu_possible_map); | ||
84 | |||
85 | DEFINE_PER_CPU(spinlock_t, ipi_lock) = SPIN_LOCK_UNLOCKED; | 70 | DEFINE_PER_CPU(spinlock_t, ipi_lock) = SPIN_LOCK_UNLOCKED; |
86 | 71 | ||
87 | enum ipi_message_type { | 72 | enum ipi_message_type { |
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c index ff9f7010097d..d1165566f064 100644 --- a/arch/powerpc/kernel/smp.c +++ b/arch/powerpc/kernel/smp.c | |||
@@ -60,13 +60,9 @@ | |||
60 | int smp_hw_index[NR_CPUS]; | 60 | int smp_hw_index[NR_CPUS]; |
61 | struct thread_info *secondary_ti; | 61 | struct thread_info *secondary_ti; |
62 | 62 | ||
63 | cpumask_t cpu_possible_map = CPU_MASK_NONE; | ||
64 | cpumask_t cpu_online_map = CPU_MASK_NONE; | ||
65 | DEFINE_PER_CPU(cpumask_t, cpu_sibling_map) = CPU_MASK_NONE; | 63 | DEFINE_PER_CPU(cpumask_t, cpu_sibling_map) = CPU_MASK_NONE; |
66 | DEFINE_PER_CPU(cpumask_t, cpu_core_map) = CPU_MASK_NONE; | 64 | DEFINE_PER_CPU(cpumask_t, cpu_core_map) = CPU_MASK_NONE; |
67 | 65 | ||
68 | EXPORT_SYMBOL(cpu_online_map); | ||
69 | EXPORT_SYMBOL(cpu_possible_map); | ||
70 | EXPORT_PER_CPU_SYMBOL(cpu_sibling_map); | 66 | EXPORT_PER_CPU_SYMBOL(cpu_sibling_map); |
71 | EXPORT_PER_CPU_SYMBOL(cpu_core_map); | 67 | EXPORT_PER_CPU_SYMBOL(cpu_core_map); |
72 | 68 | ||
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index 8116a3328a19..b4aa5869c7f9 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig | |||
@@ -75,6 +75,7 @@ config S390 | |||
75 | select HAVE_KRETPROBES | 75 | select HAVE_KRETPROBES |
76 | select HAVE_KVM if 64BIT | 76 | select HAVE_KVM if 64BIT |
77 | select HAVE_ARCH_TRACEHOOK | 77 | select HAVE_ARCH_TRACEHOOK |
78 | select INIT_ALL_POSSIBLE | ||
78 | 79 | ||
79 | source "init/Kconfig" | 80 | source "init/Kconfig" |
80 | 81 | ||
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index b5595688a477..f03914b8ed2f 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c | |||
@@ -52,12 +52,6 @@ | |||
52 | struct _lowcore *lowcore_ptr[NR_CPUS]; | 52 | struct _lowcore *lowcore_ptr[NR_CPUS]; |
53 | EXPORT_SYMBOL(lowcore_ptr); | 53 | EXPORT_SYMBOL(lowcore_ptr); |
54 | 54 | ||
55 | cpumask_t cpu_online_map = CPU_MASK_NONE; | ||
56 | EXPORT_SYMBOL(cpu_online_map); | ||
57 | |||
58 | cpumask_t cpu_possible_map = CPU_MASK_ALL; | ||
59 | EXPORT_SYMBOL(cpu_possible_map); | ||
60 | |||
61 | static struct task_struct *current_set[NR_CPUS]; | 55 | static struct task_struct *current_set[NR_CPUS]; |
62 | 56 | ||
63 | static u8 smp_cpu_type; | 57 | static u8 smp_cpu_type; |
diff --git a/arch/sh/kernel/smp.c b/arch/sh/kernel/smp.c index 3c5ad1660bbc..593937d0c495 100644 --- a/arch/sh/kernel/smp.c +++ b/arch/sh/kernel/smp.c | |||
@@ -31,12 +31,6 @@ | |||
31 | int __cpu_number_map[NR_CPUS]; /* Map physical to logical */ | 31 | int __cpu_number_map[NR_CPUS]; /* Map physical to logical */ |
32 | int __cpu_logical_map[NR_CPUS]; /* Map logical to physical */ | 32 | int __cpu_logical_map[NR_CPUS]; /* Map logical to physical */ |
33 | 33 | ||
34 | cpumask_t cpu_possible_map; | ||
35 | EXPORT_SYMBOL(cpu_possible_map); | ||
36 | |||
37 | cpumask_t cpu_online_map; | ||
38 | EXPORT_SYMBOL(cpu_online_map); | ||
39 | |||
40 | static inline void __init smp_store_cpu_info(unsigned int cpu) | 34 | static inline void __init smp_store_cpu_info(unsigned int cpu) |
41 | { | 35 | { |
42 | struct sh_cpuinfo *c = cpu_data + cpu; | 36 | struct sh_cpuinfo *c = cpu_data + cpu; |
diff --git a/arch/sparc/include/asm/smp_32.h b/arch/sparc/include/asm/smp_32.h index a8180e546a48..8408d9d2a662 100644 --- a/arch/sparc/include/asm/smp_32.h +++ b/arch/sparc/include/asm/smp_32.h | |||
@@ -29,8 +29,6 @@ | |||
29 | */ | 29 | */ |
30 | 30 | ||
31 | extern unsigned char boot_cpu_id; | 31 | extern unsigned char boot_cpu_id; |
32 | extern cpumask_t phys_cpu_present_map; | ||
33 | #define cpu_possible_map phys_cpu_present_map | ||
34 | 32 | ||
35 | typedef void (*smpfunc_t)(unsigned long, unsigned long, unsigned long, | 33 | typedef void (*smpfunc_t)(unsigned long, unsigned long, unsigned long, |
36 | unsigned long, unsigned long); | 34 | unsigned long, unsigned long); |
diff --git a/arch/sparc/kernel/smp.c b/arch/sparc/kernel/smp.c index e396c1f17a92..1e5ac4e282e1 100644 --- a/arch/sparc/kernel/smp.c +++ b/arch/sparc/kernel/smp.c | |||
@@ -39,8 +39,6 @@ volatile unsigned long cpu_callin_map[NR_CPUS] __cpuinitdata = {0,}; | |||
39 | unsigned char boot_cpu_id = 0; | 39 | unsigned char boot_cpu_id = 0; |
40 | unsigned char boot_cpu_id4 = 0; /* boot_cpu_id << 2 */ | 40 | unsigned char boot_cpu_id4 = 0; /* boot_cpu_id << 2 */ |
41 | 41 | ||
42 | cpumask_t cpu_online_map = CPU_MASK_NONE; | ||
43 | cpumask_t phys_cpu_present_map = CPU_MASK_NONE; | ||
44 | cpumask_t smp_commenced_mask = CPU_MASK_NONE; | 42 | cpumask_t smp_commenced_mask = CPU_MASK_NONE; |
45 | 43 | ||
46 | /* The only guaranteed locking primitive available on all Sparc | 44 | /* The only guaranteed locking primitive available on all Sparc |
@@ -334,7 +332,7 @@ void __init smp_setup_cpu_possible_map(void) | |||
334 | instance = 0; | 332 | instance = 0; |
335 | while (!cpu_find_by_instance(instance, NULL, &mid)) { | 333 | while (!cpu_find_by_instance(instance, NULL, &mid)) { |
336 | if (mid < NR_CPUS) { | 334 | if (mid < NR_CPUS) { |
337 | cpu_set(mid, phys_cpu_present_map); | 335 | cpu_set(mid, cpu_possible_map); |
338 | cpu_set(mid, cpu_present_map); | 336 | cpu_set(mid, cpu_present_map); |
339 | } | 337 | } |
340 | instance++; | 338 | instance++; |
@@ -354,7 +352,7 @@ void __init smp_prepare_boot_cpu(void) | |||
354 | 352 | ||
355 | current_thread_info()->cpu = cpuid; | 353 | current_thread_info()->cpu = cpuid; |
356 | cpu_set(cpuid, cpu_online_map); | 354 | cpu_set(cpuid, cpu_online_map); |
357 | cpu_set(cpuid, phys_cpu_present_map); | 355 | cpu_set(cpuid, cpu_possible_map); |
358 | } | 356 | } |
359 | 357 | ||
360 | int __cpuinit __cpu_up(unsigned int cpu) | 358 | int __cpuinit __cpu_up(unsigned int cpu) |
diff --git a/arch/sparc/kernel/sparc_ksyms.c b/arch/sparc/kernel/sparc_ksyms.c index b0dfff848653..32d11a5fe3a8 100644 --- a/arch/sparc/kernel/sparc_ksyms.c +++ b/arch/sparc/kernel/sparc_ksyms.c | |||
@@ -113,10 +113,6 @@ EXPORT_PER_CPU_SYMBOL(__cpu_data); | |||
113 | #ifdef CONFIG_SMP | 113 | #ifdef CONFIG_SMP |
114 | /* IRQ implementation. */ | 114 | /* IRQ implementation. */ |
115 | EXPORT_SYMBOL(synchronize_irq); | 115 | EXPORT_SYMBOL(synchronize_irq); |
116 | |||
117 | /* CPU online map and active count. */ | ||
118 | EXPORT_SYMBOL(cpu_online_map); | ||
119 | EXPORT_SYMBOL(phys_cpu_present_map); | ||
120 | #endif | 116 | #endif |
121 | 117 | ||
122 | EXPORT_SYMBOL(__udelay); | 118 | EXPORT_SYMBOL(__udelay); |
diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c index f500b0618bb0..a97b8822c22c 100644 --- a/arch/sparc64/kernel/smp.c +++ b/arch/sparc64/kernel/smp.c | |||
@@ -49,14 +49,10 @@ | |||
49 | 49 | ||
50 | int sparc64_multi_core __read_mostly; | 50 | int sparc64_multi_core __read_mostly; |
51 | 51 | ||
52 | cpumask_t cpu_possible_map __read_mostly = CPU_MASK_NONE; | ||
53 | cpumask_t cpu_online_map __read_mostly = CPU_MASK_NONE; | ||
54 | DEFINE_PER_CPU(cpumask_t, cpu_sibling_map) = CPU_MASK_NONE; | 52 | DEFINE_PER_CPU(cpumask_t, cpu_sibling_map) = CPU_MASK_NONE; |
55 | cpumask_t cpu_core_map[NR_CPUS] __read_mostly = | 53 | cpumask_t cpu_core_map[NR_CPUS] __read_mostly = |
56 | { [0 ... NR_CPUS-1] = CPU_MASK_NONE }; | 54 | { [0 ... NR_CPUS-1] = CPU_MASK_NONE }; |
57 | 55 | ||
58 | EXPORT_SYMBOL(cpu_possible_map); | ||
59 | EXPORT_SYMBOL(cpu_online_map); | ||
60 | EXPORT_PER_CPU_SYMBOL(cpu_sibling_map); | 56 | EXPORT_PER_CPU_SYMBOL(cpu_sibling_map); |
61 | EXPORT_SYMBOL(cpu_core_map); | 57 | EXPORT_SYMBOL(cpu_core_map); |
62 | 58 | ||
diff --git a/arch/um/kernel/smp.c b/arch/um/kernel/smp.c index 045772142844..98351c78bc81 100644 --- a/arch/um/kernel/smp.c +++ b/arch/um/kernel/smp.c | |||
@@ -25,13 +25,6 @@ DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); | |||
25 | #include "irq_user.h" | 25 | #include "irq_user.h" |
26 | #include "os.h" | 26 | #include "os.h" |
27 | 27 | ||
28 | /* CPU online map, set by smp_boot_cpus */ | ||
29 | cpumask_t cpu_online_map = CPU_MASK_NONE; | ||
30 | cpumask_t cpu_possible_map = CPU_MASK_NONE; | ||
31 | |||
32 | EXPORT_SYMBOL(cpu_online_map); | ||
33 | EXPORT_SYMBOL(cpu_possible_map); | ||
34 | |||
35 | /* Per CPU bogomips and other parameters | 28 | /* Per CPU bogomips and other parameters |
36 | * The only piece used here is the ipi pipe, which is set before SMP is | 29 | * The only piece used here is the ipi pipe, which is set before SMP is |
37 | * started and never changed. | 30 | * started and never changed. |
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 7b1093397319..468c2f9d47ae 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c | |||
@@ -101,14 +101,8 @@ EXPORT_SYMBOL(smp_num_siblings); | |||
101 | /* Last level cache ID of each logical CPU */ | 101 | /* Last level cache ID of each logical CPU */ |
102 | DEFINE_PER_CPU(u16, cpu_llc_id) = BAD_APICID; | 102 | DEFINE_PER_CPU(u16, cpu_llc_id) = BAD_APICID; |
103 | 103 | ||
104 | /* bitmap of online cpus */ | ||
105 | cpumask_t cpu_online_map __read_mostly; | ||
106 | EXPORT_SYMBOL(cpu_online_map); | ||
107 | |||
108 | cpumask_t cpu_callin_map; | 104 | cpumask_t cpu_callin_map; |
109 | cpumask_t cpu_callout_map; | 105 | cpumask_t cpu_callout_map; |
110 | cpumask_t cpu_possible_map; | ||
111 | EXPORT_SYMBOL(cpu_possible_map); | ||
112 | 106 | ||
113 | /* representing HT siblings of each logical CPU */ | 107 | /* representing HT siblings of each logical CPU */ |
114 | DEFINE_PER_CPU(cpumask_t, cpu_sibling_map); | 108 | DEFINE_PER_CPU(cpumask_t, cpu_sibling_map); |
diff --git a/arch/x86/mach-voyager/voyager_smp.c b/arch/x86/mach-voyager/voyager_smp.c index 52145007bd7e..9c990185e9f2 100644 --- a/arch/x86/mach-voyager/voyager_smp.c +++ b/arch/x86/mach-voyager/voyager_smp.c | |||
@@ -63,11 +63,6 @@ static int voyager_extended_cpus = 1; | |||
63 | /* Used for the invalidate map that's also checked in the spinlock */ | 63 | /* Used for the invalidate map that's also checked in the spinlock */ |
64 | static volatile unsigned long smp_invalidate_needed; | 64 | static volatile unsigned long smp_invalidate_needed; |
65 | 65 | ||
66 | /* Bitmask of currently online CPUs - used by setup.c for | ||
67 | /proc/cpuinfo, visible externally but still physical */ | ||
68 | cpumask_t cpu_online_map = CPU_MASK_NONE; | ||
69 | EXPORT_SYMBOL(cpu_online_map); | ||
70 | |||
71 | /* Bitmask of CPUs present in the system - exported by i386_syms.c, used | 66 | /* Bitmask of CPUs present in the system - exported by i386_syms.c, used |
72 | * by scheduler but indexed physically */ | 67 | * by scheduler but indexed physically */ |
73 | cpumask_t phys_cpu_present_map = CPU_MASK_NONE; | 68 | cpumask_t phys_cpu_present_map = CPU_MASK_NONE; |
@@ -218,8 +213,6 @@ static cpumask_t smp_commenced_mask = CPU_MASK_NONE; | |||
218 | /* This is for the new dynamic CPU boot code */ | 213 | /* This is for the new dynamic CPU boot code */ |
219 | cpumask_t cpu_callin_map = CPU_MASK_NONE; | 214 | cpumask_t cpu_callin_map = CPU_MASK_NONE; |
220 | cpumask_t cpu_callout_map = CPU_MASK_NONE; | 215 | cpumask_t cpu_callout_map = CPU_MASK_NONE; |
221 | cpumask_t cpu_possible_map = CPU_MASK_NONE; | ||
222 | EXPORT_SYMBOL(cpu_possible_map); | ||
223 | 216 | ||
224 | /* The per processor IRQ masks (these are usually kept in sync) */ | 217 | /* The per processor IRQ masks (these are usually kept in sync) */ |
225 | static __u16 vic_irq_mask[NR_CPUS] __cacheline_aligned; | 218 | static __u16 vic_irq_mask[NR_CPUS] __cacheline_aligned; |
diff --git a/include/asm-m32r/smp.h b/include/asm-m32r/smp.h index c5dd66916692..b96a6d2ffbc3 100644 --- a/include/asm-m32r/smp.h +++ b/include/asm-m32r/smp.h | |||
@@ -63,8 +63,6 @@ extern volatile int cpu_2_physid[NR_CPUS]; | |||
63 | #define raw_smp_processor_id() (current_thread_info()->cpu) | 63 | #define raw_smp_processor_id() (current_thread_info()->cpu) |
64 | 64 | ||
65 | extern cpumask_t cpu_callout_map; | 65 | extern cpumask_t cpu_callout_map; |
66 | extern cpumask_t cpu_possible_map; | ||
67 | extern cpumask_t cpu_present_map; | ||
68 | 66 | ||
69 | static __inline__ int hard_smp_processor_id(void) | 67 | static __inline__ int hard_smp_processor_id(void) |
70 | { | 68 | { |
diff --git a/init/Kconfig b/init/Kconfig index f763762d544a..7656623f5006 100644 --- a/init/Kconfig +++ b/init/Kconfig | |||
@@ -916,6 +916,15 @@ config KMOD | |||
916 | 916 | ||
917 | endif # MODULES | 917 | endif # MODULES |
918 | 918 | ||
919 | config INIT_ALL_POSSIBLE | ||
920 | bool | ||
921 | help | ||
922 | Back when each arch used to define their own cpu_online_map and | ||
923 | cpu_possible_map, some of them chose to initialize cpu_possible_map | ||
924 | with all 1s, and others with all 0s. When they were centralised, | ||
925 | it was better to provide this option than to break all the archs | ||
926 | and have several arch maintainers persuing me down dark alleys. | ||
927 | |||
919 | config STOP_MACHINE | 928 | config STOP_MACHINE |
920 | bool | 929 | bool |
921 | default y | 930 | default y |
diff --git a/kernel/cpu.c b/kernel/cpu.c index 8ea32e8d68b0..bae131a1211b 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c | |||
@@ -24,19 +24,20 @@ | |||
24 | cpumask_t cpu_present_map __read_mostly; | 24 | cpumask_t cpu_present_map __read_mostly; |
25 | EXPORT_SYMBOL(cpu_present_map); | 25 | EXPORT_SYMBOL(cpu_present_map); |
26 | 26 | ||
27 | #ifndef CONFIG_SMP | ||
28 | |||
29 | /* | 27 | /* |
30 | * Represents all cpu's that are currently online. | 28 | * Represents all cpu's that are currently online. |
31 | */ | 29 | */ |
32 | cpumask_t cpu_online_map __read_mostly = CPU_MASK_ALL; | 30 | cpumask_t cpu_online_map __read_mostly; |
33 | EXPORT_SYMBOL(cpu_online_map); | 31 | EXPORT_SYMBOL(cpu_online_map); |
34 | 32 | ||
33 | #ifdef CONFIG_INIT_ALL_POSSIBLE | ||
35 | cpumask_t cpu_possible_map __read_mostly = CPU_MASK_ALL; | 34 | cpumask_t cpu_possible_map __read_mostly = CPU_MASK_ALL; |
35 | #else | ||
36 | cpumask_t cpu_possible_map __read_mostly; | ||
37 | #endif | ||
36 | EXPORT_SYMBOL(cpu_possible_map); | 38 | EXPORT_SYMBOL(cpu_possible_map); |
37 | 39 | ||
38 | #else /* CONFIG_SMP */ | 40 | #ifdef CONFIG_SMP |
39 | |||
40 | /* Serializes the updates to cpu_online_map, cpu_present_map */ | 41 | /* Serializes the updates to cpu_online_map, cpu_present_map */ |
41 | static DEFINE_MUTEX(cpu_add_remove_lock); | 42 | static DEFINE_MUTEX(cpu_add_remove_lock); |
42 | 43 | ||