diff options
Diffstat (limited to 'arch/x86/kernel/smpboot.c')
-rw-r--r-- | arch/x86/kernel/smpboot.c | 66 |
1 files changed, 40 insertions, 26 deletions
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 91055d7fc1b0..7985c5b3f916 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c | |||
@@ -756,6 +756,14 @@ static void __cpuinit do_fork_idle(struct work_struct *work) | |||
756 | } | 756 | } |
757 | 757 | ||
758 | #ifdef CONFIG_X86_64 | 758 | #ifdef CONFIG_X86_64 |
759 | |||
760 | /* __ref because it's safe to call free_bootmem when after_bootmem == 0. */ | ||
761 | static void __ref free_bootmem_pda(struct x8664_pda *oldpda) | ||
762 | { | ||
763 | if (!after_bootmem) | ||
764 | free_bootmem((unsigned long)oldpda, sizeof(*oldpda)); | ||
765 | } | ||
766 | |||
759 | /* | 767 | /* |
760 | * Allocate node local memory for the AP pda. | 768 | * Allocate node local memory for the AP pda. |
761 | * | 769 | * |
@@ -784,8 +792,7 @@ int __cpuinit get_local_pda(int cpu) | |||
784 | 792 | ||
785 | if (oldpda) { | 793 | if (oldpda) { |
786 | memcpy(newpda, oldpda, size); | 794 | memcpy(newpda, oldpda, size); |
787 | if (!after_bootmem) | 795 | free_bootmem_pda(oldpda); |
788 | free_bootmem((unsigned long)oldpda, size); | ||
789 | } | 796 | } |
790 | 797 | ||
791 | newpda->in_bootmem = 0; | 798 | newpda->in_bootmem = 0; |
@@ -994,17 +1001,7 @@ int __cpuinit native_cpu_up(unsigned int cpu) | |||
994 | flush_tlb_all(); | 1001 | flush_tlb_all(); |
995 | low_mappings = 1; | 1002 | low_mappings = 1; |
996 | 1003 | ||
997 | #ifdef CONFIG_X86_PC | ||
998 | if (def_to_bigsmp && apicid > 8) { | ||
999 | printk(KERN_WARNING | ||
1000 | "More than 8 CPUs detected - skipping them.\n" | ||
1001 | "Use CONFIG_X86_GENERICARCH and CONFIG_X86_BIGSMP.\n"); | ||
1002 | err = -1; | ||
1003 | } else | ||
1004 | err = do_boot_cpu(apicid, cpu); | ||
1005 | #else | ||
1006 | err = do_boot_cpu(apicid, cpu); | 1004 | err = do_boot_cpu(apicid, cpu); |
1007 | #endif | ||
1008 | 1005 | ||
1009 | zap_low_mappings(); | 1006 | zap_low_mappings(); |
1010 | low_mappings = 0; | 1007 | low_mappings = 0; |
@@ -1058,6 +1055,34 @@ static __init void disable_smp(void) | |||
1058 | static int __init smp_sanity_check(unsigned max_cpus) | 1055 | static int __init smp_sanity_check(unsigned max_cpus) |
1059 | { | 1056 | { |
1060 | preempt_disable(); | 1057 | preempt_disable(); |
1058 | |||
1059 | #if defined(CONFIG_X86_PC) && defined(CONFIG_X86_32) | ||
1060 | if (def_to_bigsmp && nr_cpu_ids > 8) { | ||
1061 | unsigned int cpu; | ||
1062 | unsigned nr; | ||
1063 | |||
1064 | printk(KERN_WARNING | ||
1065 | "More than 8 CPUs detected - skipping them.\n" | ||
1066 | "Use CONFIG_X86_GENERICARCH and CONFIG_X86_BIGSMP.\n"); | ||
1067 | |||
1068 | nr = 0; | ||
1069 | for_each_present_cpu(cpu) { | ||
1070 | if (nr >= 8) | ||
1071 | cpu_clear(cpu, cpu_present_map); | ||
1072 | nr++; | ||
1073 | } | ||
1074 | |||
1075 | nr = 0; | ||
1076 | for_each_possible_cpu(cpu) { | ||
1077 | if (nr >= 8) | ||
1078 | cpu_clear(cpu, cpu_possible_map); | ||
1079 | nr++; | ||
1080 | } | ||
1081 | |||
1082 | nr_cpu_ids = 8; | ||
1083 | } | ||
1084 | #endif | ||
1085 | |||
1061 | if (!physid_isset(hard_smp_processor_id(), phys_cpu_present_map)) { | 1086 | if (!physid_isset(hard_smp_processor_id(), phys_cpu_present_map)) { |
1062 | printk(KERN_WARNING "weird, boot CPU (#%d) not listed" | 1087 | printk(KERN_WARNING "weird, boot CPU (#%d) not listed" |
1063 | "by the BIOS.\n", hard_smp_processor_id()); | 1088 | "by the BIOS.\n", hard_smp_processor_id()); |
@@ -1196,6 +1221,9 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus) | |||
1196 | printk(KERN_INFO "CPU%d: ", 0); | 1221 | printk(KERN_INFO "CPU%d: ", 0); |
1197 | print_cpu_info(&cpu_data(0)); | 1222 | print_cpu_info(&cpu_data(0)); |
1198 | setup_boot_clock(); | 1223 | setup_boot_clock(); |
1224 | |||
1225 | if (is_uv_system()) | ||
1226 | uv_system_init(); | ||
1199 | out: | 1227 | out: |
1200 | preempt_enable(); | 1228 | preempt_enable(); |
1201 | } | 1229 | } |
@@ -1386,17 +1414,3 @@ void __cpu_die(unsigned int cpu) | |||
1386 | BUG(); | 1414 | BUG(); |
1387 | } | 1415 | } |
1388 | #endif | 1416 | #endif |
1389 | |||
1390 | /* | ||
1391 | * If the BIOS enumerates physical processors before logical, | ||
1392 | * maxcpus=N at enumeration-time can be used to disable HT. | ||
1393 | */ | ||
1394 | static int __init parse_maxcpus(char *arg) | ||
1395 | { | ||
1396 | extern unsigned int maxcpus; | ||
1397 | |||
1398 | if (arg) | ||
1399 | maxcpus = simple_strtoul(arg, NULL, 0); | ||
1400 | return 0; | ||
1401 | } | ||
1402 | early_param("maxcpus", parse_maxcpus); | ||