提交 a58f03b0 编写于 作者: Y Yinghai Lu 提交者: Ingo Molnar

x86: check bigsmp in smp_sanity_check instead of cpu_up

clear bits for cpu nr > 8.

This allows us to boot the full range of possible CPUs that the
supported APIC model will allow. Previously we'd hang or boot up
with less than 8 CPUs.
Signed-off-by: NYinghai Lu <yhlu.kernel@gmail.com>
Tested-by: NJeff Chua <jeff.chua.linux@gmail.com>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 858f7747
...@@ -994,17 +994,7 @@ int __cpuinit native_cpu_up(unsigned int cpu) ...@@ -994,17 +994,7 @@ int __cpuinit native_cpu_up(unsigned int cpu)
flush_tlb_all(); flush_tlb_all();
low_mappings = 1; 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); err = do_boot_cpu(apicid, cpu);
#endif
zap_low_mappings(); zap_low_mappings();
low_mappings = 0; low_mappings = 0;
...@@ -1058,6 +1048,34 @@ static __init void disable_smp(void) ...@@ -1058,6 +1048,34 @@ static __init void disable_smp(void)
static int __init smp_sanity_check(unsigned max_cpus) static int __init smp_sanity_check(unsigned max_cpus)
{ {
preempt_disable(); 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)) { if (!physid_isset(hard_smp_processor_id(), phys_cpu_present_map)) {
printk(KERN_WARNING "weird, boot CPU (#%d) not listed" printk(KERN_WARNING "weird, boot CPU (#%d) not listed"
"by the BIOS.\n", hard_smp_processor_id()); "by the BIOS.\n", hard_smp_processor_id());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册