diff options
author | KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> | 2007-10-19 02:40:47 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-19 14:53:44 -0400 |
commit | 73e753a50dcac7d6d4fa8b9552203ef544a70d77 (patch) | |
tree | 7e8569cb99f6792bb436a07ec5ea45632b9c4ecf /kernel/cpu.c | |
parent | 470fd646444c65a5d062a371f5ec8dcedee61239 (diff) |
CPU HOTPLUG: avoid hotadd when proper possible_map isn't specified
cpu-hot-add should be fail if cpu is not set in cpu_possible_map. If go
ahead, the system will panic soon.
Especially, arch which requires additional_cpus= parameter should handle
this. Tested on ia64.
[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/cpu.c')
-rw-r--r-- | kernel/cpu.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/cpu.c b/kernel/cpu.c index ebf6647a2bd..6b3a0c15144 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c | |||
@@ -265,6 +265,15 @@ out_notify: | |||
265 | int __cpuinit cpu_up(unsigned int cpu) | 265 | int __cpuinit cpu_up(unsigned int cpu) |
266 | { | 266 | { |
267 | int err = 0; | 267 | int err = 0; |
268 | if (!cpu_isset(cpu, cpu_possible_map)) { | ||
269 | printk(KERN_ERR "can't online cpu %d because it is not " | ||
270 | "configured as may-hotadd at boot time\n", cpu); | ||
271 | #if defined(CONFIG_IA64) || defined(CONFIG_X86_64) || defined(CONFIG_S390) | ||
272 | printk(KERN_ERR "please check additional_cpus= boot " | ||
273 | "parameter\n"); | ||
274 | #endif | ||
275 | return -EINVAL; | ||
276 | } | ||
268 | 277 | ||
269 | mutex_lock(&cpu_add_remove_lock); | 278 | mutex_lock(&cpu_add_remove_lock); |
270 | if (cpu_hotplug_disabled) | 279 | if (cpu_hotplug_disabled) |