[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20070921125401.6777139f.kamezawa.hiroyu@jp.fujitsu.com>
Date: Fri, 21 Sep 2007 12:54:01 +0900
From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: GOTO <y-goto@...fujitsu.com>, takeuchi_satoru@...fujitsu.com,
LKML <linux-kernel@...r.kernel.org>
Subject: [RFC][PATCH] make mis-configured cpu hotplug safer
When we want to hot-add a new cpu, it should be on cpu_possible_map.
On some archs, we have to specify additional_cpus= boot option.
(x86_64, ia64, s390 seems to need this. others ?)
If a user enable a cpu which is not counted as possible_cpu, the system
will panic. This patch disables to register cpu control if cpu is not in
possible_map.
Works as expected on ia64/cpu-hotplug-by-ACPI case.
Consideration:
handling this issue in cpu_up() is an another way.
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
---
drivers/base/cpu.c | 11 +++++++++++
1 file changed, 11 insertions(+)
Index: linux-2.6.23-rc6-mm1/drivers/base/cpu.c
===================================================================
--- linux-2.6.23-rc6-mm1.orig/drivers/base/cpu.c
+++ linux-2.6.23-rc6-mm1/drivers/base/cpu.c
@@ -113,6 +113,17 @@ static SYSDEV_ATTR(crash_notes, 0400, sh
int __devinit register_cpu(struct cpu *cpu, int num)
{
int error;
+
+#ifdef CONFIG_HOTPLUG_CPU
+ if (!cpu_isset(num, cpu_possible_map)) {
+ printk("Newly added cpu is not configured"
+ "as hot-add-candidate at boot time\n");
+#if defined(CONFIG_X86_64) || defined(CONFIG_IA64) || defined(CONFIG_S390)
+ printk("please check additional_cpus= boot option\n");
+#endif
+ return -EINVAL;
+ }
+#endif
cpu->node_id = cpu_to_node(num);
cpu->sysdev.id = num;
cpu->sysdev.cls = &cpu_sysdev_class;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists