]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/kernel/smpboot.c
Merge branch 'x86/cpu' into x86/core
[linux-2.6-omap-h63xx.git] / arch / x86 / kernel / smpboot.c
index 0133a952d11f6163d1652113a4b57c2c8dc48f8b..aa804c64b1677ffe6d7433de542c04c9c9e8470d 100644 (file)
@@ -749,6 +749,14 @@ static void __cpuinit do_fork_idle(struct work_struct *work)
 }
 
 #ifdef CONFIG_X86_64
+
+/* __ref because it's safe to call free_bootmem when after_bootmem == 0. */
+static void __ref free_bootmem_pda(struct x8664_pda *oldpda)
+{
+       if (!after_bootmem)
+               free_bootmem((unsigned long)oldpda, sizeof(*oldpda));
+}
+
 /*
  * Allocate node local memory for the AP pda.
  *
@@ -777,8 +785,7 @@ int __cpuinit get_local_pda(int cpu)
 
        if (oldpda) {
                memcpy(newpda, oldpda, size);
-               if (!after_bootmem)
-                       free_bootmem((unsigned long)oldpda, size);
+               free_bootmem_pda(oldpda);
        }
 
        newpda->in_bootmem = 0;
@@ -987,17 +994,7 @@ int __cpuinit native_cpu_up(unsigned int cpu)
        flush_tlb_all();
        low_mappings = 1;
 
-#ifdef CONFIG_X86_PC
-       if (def_to_bigsmp && apicid > 8) {
-               printk(KERN_WARNING
-                       "More than 8 CPUs detected - skipping them.\n"
-                       "Use CONFIG_X86_GENERICARCH and CONFIG_X86_BIGSMP.\n");
-               err = -1;
-       } else
-               err = do_boot_cpu(apicid, cpu);
-#else
        err = do_boot_cpu(apicid, cpu);
-#endif
 
        zap_low_mappings();
        low_mappings = 0;
@@ -1051,6 +1048,34 @@ static __init void disable_smp(void)
 static int __init smp_sanity_check(unsigned max_cpus)
 {
        preempt_disable();
+
+#if defined(CONFIG_X86_PC) && defined(CONFIG_X86_32)
+       if (def_to_bigsmp && nr_cpu_ids > 8) {
+               unsigned int cpu;
+               unsigned nr;
+
+               printk(KERN_WARNING
+                      "More than 8 CPUs detected - skipping them.\n"
+                      "Use CONFIG_X86_GENERICARCH and CONFIG_X86_BIGSMP.\n");
+
+               nr = 0;
+               for_each_present_cpu(cpu) {
+                       if (nr >= 8)
+                               cpu_clear(cpu, cpu_present_map);
+                       nr++;
+               }
+
+               nr = 0;
+               for_each_possible_cpu(cpu) {
+                       if (nr >= 8)
+                               cpu_clear(cpu, cpu_possible_map);
+                       nr++;
+               }
+
+               nr_cpu_ids = 8;
+       }
+#endif
+
        if (!physid_isset(hard_smp_processor_id(), phys_cpu_present_map)) {
                printk(KERN_WARNING "weird, boot CPU (#%d) not listed"
                                    "by the BIOS.\n", hard_smp_processor_id());
@@ -1196,6 +1221,9 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus)
        printk(KERN_INFO "CPU%d: ", 0);
        print_cpu_info(&cpu_data(0));
        setup_boot_clock();
+
+       if (is_uv_system())
+               uv_system_init();
 out:
        preempt_enable();
 }
@@ -1386,17 +1414,3 @@ void __cpu_die(unsigned int cpu)
        BUG();
 }
 #endif
-
-/*
- * If the BIOS enumerates physical processors before logical,
- * maxcpus=N at enumeration-time can be used to disable HT.
- */
-static int __init parse_maxcpus(char *arg)
-{
-       extern unsigned int maxcpus;
-
-       if (arg)
-               maxcpus = simple_strtoul(arg, NULL, 0);
-       return 0;
-}
-early_param("maxcpus", parse_maxcpus);