From 0f9aa273bec4e68af9b1bbb4f5eece3f6f3e8a96 Mon Sep 17 00:00:00 2001 From: Yinghai Lu Date: Thu, 14 Aug 2008 02:16:30 -0700 Subject: [PATCH] --- yaml --- r: 108671 b: refs/heads/master c: a58f03b07539f6575adaa011712fa139c9343742 h: refs/heads/master i: 108669: fe0f4a601aa71c219d7a82d43d9bb5a825816c60 108667: 874cce57272ffa2844d3ff50357e52b781df0052 108663: 975a838ea92be6a0a7465856e55a1a52b0c435ae 108655: fbe3b2f1024161f7470c8104c1a609a5da07d846 108639: 3371a81189dcf6eaf00df68389ac8defe05d94b2 108607: 25c6d43f5886f2c872f587cf0805340f83cbbac0 108543: b556ed9a0c627a1c24390bd7981ba988607a53b7 v: v3 --- [refs] | 2 +- trunk/arch/x86/kernel/smpboot.c | 38 ++++++++++++++++++++++++--------- 2 files changed, 29 insertions(+), 11 deletions(-) diff --git a/[refs] b/[refs] index 2d856b403958..24eb9e1b4ee3 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 858f774733b72609acb28104475f131abb912c08 +refs/heads/master: a58f03b07539f6575adaa011712fa139c9343742 diff --git a/trunk/arch/x86/kernel/smpboot.c b/trunk/arch/x86/kernel/smpboot.c index e25287e4a85f..a8fb8a980fae 100644 --- a/trunk/arch/x86/kernel/smpboot.c +++ b/trunk/arch/x86/kernel/smpboot.c @@ -994,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; @@ -1058,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());