From: Ashok Raj <ashok.raj@intel.com>

No need to enforce_max_cpus when hotplug code is enabled.  This nukes out
cpu_present_map and cpu_possible_map making it impossible to add new cpus in
the system.

Signed-off-by: Ashok Raj <ashok.raj@intel.com>
Cc: Andi Kleen <ak@muc.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 arch/x86_64/kernel/smpboot.c |   40 +++++++++++++++++++++++-----------------
 1 files changed, 23 insertions(+), 17 deletions(-)

diff -puN arch/x86_64/kernel/smpboot.c~x86_64dont-call-enforce_max_cpus-when-hotplug-is-enabled arch/x86_64/kernel/smpboot.c
--- devel/arch/x86_64/kernel/smpboot.c~x86_64dont-call-enforce_max_cpus-when-hotplug-is-enabled	2005-08-21 23:48:24.000000000 -0700
+++ devel-akpm/arch/x86_64/kernel/smpboot.c	2005-08-21 23:48:24.000000000 -0700
@@ -894,23 +894,6 @@ static __init void disable_smp(void)
 	cpu_set(0, cpu_core_map[0]);
 }
 
-/*
- * Handle user cpus=... parameter.
- */
-static __init void enforce_max_cpus(unsigned max_cpus)
-{
-	int i, k;
-	k = 0;
-	for (i = 0; i < NR_CPUS; i++) {
-		if (!cpu_possible(i))
-			continue;
-		if (++k > max_cpus) {
-			cpu_clear(i, cpu_possible_map);
-			cpu_clear(i, cpu_present_map);
-		}
-	}
-}
-
 #ifdef CONFIG_HOTPLUG_CPU
 /*
  * cpu_possible_map should be static, it cannot change as cpu's
@@ -930,6 +913,29 @@ static void prefill_possible_map(void)
 	for (i = 0; i < NR_CPUS; i++)
 		cpu_set(i, cpu_possible_map);
 }
+
+/*
+ * Dont need this when we have hotplug enabled
+ */
+#define enforce_max_cpus(x)
+
+#else
+/*
+ * Handle user cpus=... parameter.
+ */
+static __init void enforce_max_cpus(unsigned max_cpus)
+{
+	int i, k;
+	k = 0;
+
+	for_each_cpu(i) {
+		if (++k > max_cpus) {
+			cpu_clear(i, cpu_possible_map);
+			cpu_clear(i, cpu_present_map);
+		}
+	}
+}
+
 #endif
 
 /*
_