diff options
author | Glauber de Oliveira Costa <gcosta@redhat.com> | 2008-03-19 13:25:14 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-17 11:41:00 -0400 |
commit | b675f11127291cdb6a090ece289e4f9a0b1d609e (patch) | |
tree | 09ca4ae731054d1d27ffa67481c6289583878291 | |
parent | 4780b261e2b71ca72804b26479d794839e68d9ab (diff) |
x86: isolate logic to disable smp
Put it in a disable_smp() function, as x86_64 does
Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | arch/x86/kernel/smpboot_32.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/arch/x86/kernel/smpboot_32.c b/arch/x86/kernel/smpboot_32.c index b44a743d0ea9..8144aa3a1edf 100644 --- a/arch/x86/kernel/smpboot_32.c +++ b/arch/x86/kernel/smpboot_32.c | |||
@@ -742,6 +742,15 @@ void *xquad_portio; | |||
742 | EXPORT_SYMBOL(xquad_portio); | 742 | EXPORT_SYMBOL(xquad_portio); |
743 | #endif | 743 | #endif |
744 | 744 | ||
745 | static void __init disable_smp(void) | ||
746 | { | ||
747 | smpboot_clear_io_apic_irqs(); | ||
748 | phys_cpu_present_map = physid_mask_of_physid(0); | ||
749 | map_cpu_to_logical_apicid(); | ||
750 | cpu_set(0, per_cpu(cpu_sibling_map, 0)); | ||
751 | cpu_set(0, per_cpu(cpu_core_map, 0)); | ||
752 | } | ||
753 | |||
745 | static int __init smp_sanity_check(unsigned max_cpus) | 754 | static int __init smp_sanity_check(unsigned max_cpus) |
746 | { | 755 | { |
747 | /* | 756 | /* |
@@ -750,14 +759,10 @@ static int __init smp_sanity_check(unsigned max_cpus) | |||
750 | */ | 759 | */ |
751 | if (!smp_found_config && !acpi_lapic) { | 760 | if (!smp_found_config && !acpi_lapic) { |
752 | printk(KERN_NOTICE "SMP motherboard not detected.\n"); | 761 | printk(KERN_NOTICE "SMP motherboard not detected.\n"); |
753 | smpboot_clear_io_apic_irqs(); | 762 | disable_smp(); |
754 | phys_cpu_present_map = physid_mask_of_physid(0); | ||
755 | if (APIC_init_uniprocessor()) | 763 | if (APIC_init_uniprocessor()) |
756 | printk(KERN_NOTICE "Local APIC not detected." | 764 | printk(KERN_NOTICE "Local APIC not detected." |
757 | " Using dummy APIC emulation.\n"); | 765 | " Using dummy APIC emulation.\n"); |
758 | map_cpu_to_logical_apicid(); | ||
759 | cpu_set(0, per_cpu(cpu_sibling_map, 0)); | ||
760 | cpu_set(0, per_cpu(cpu_core_map, 0)); | ||
761 | return -1; | 766 | return -1; |
762 | } | 767 | } |
763 | 768 | ||
@@ -779,11 +784,6 @@ static int __init smp_sanity_check(unsigned max_cpus) | |||
779 | printk(KERN_ERR "BIOS bug, local APIC #%d not detected!...\n", | 784 | printk(KERN_ERR "BIOS bug, local APIC #%d not detected!...\n", |
780 | boot_cpu_physical_apicid); | 785 | boot_cpu_physical_apicid); |
781 | printk(KERN_ERR "... forcing use of dummy APIC emulation. (tell your hw vendor)\n"); | 786 | printk(KERN_ERR "... forcing use of dummy APIC emulation. (tell your hw vendor)\n"); |
782 | smpboot_clear_io_apic_irqs(); | ||
783 | phys_cpu_present_map = physid_mask_of_physid(0); | ||
784 | map_cpu_to_logical_apicid(); | ||
785 | cpu_set(0, per_cpu(cpu_sibling_map, 0)); | ||
786 | cpu_set(0, per_cpu(cpu_core_map, 0)); | ||
787 | return -1; | 787 | return -1; |
788 | } | 788 | } |
789 | 789 | ||
@@ -801,11 +801,6 @@ static int __init smp_sanity_check(unsigned max_cpus) | |||
801 | connect_bsp_APIC(); | 801 | connect_bsp_APIC(); |
802 | setup_local_APIC(); | 802 | setup_local_APIC(); |
803 | } | 803 | } |
804 | smpboot_clear_io_apic_irqs(); | ||
805 | phys_cpu_present_map = physid_mask_of_physid(0); | ||
806 | map_cpu_to_logical_apicid(); | ||
807 | cpu_set(0, per_cpu(cpu_sibling_map, 0)); | ||
808 | cpu_set(0, per_cpu(cpu_core_map, 0)); | ||
809 | return -1; | 804 | return -1; |
810 | } | 805 | } |
811 | return 0; | 806 | return 0; |
@@ -835,7 +830,12 @@ static void __init smp_boot_cpus(unsigned int max_cpus) | |||
835 | 830 | ||
836 | set_cpu_sibling_map(0); | 831 | set_cpu_sibling_map(0); |
837 | 832 | ||
838 | smp_sanity_check(max_cpus); | 833 | if (smp_sanity_check(max_cpus) < 0) { |
834 | printk(KERN_INFO "SMP disabled\n"); | ||
835 | disable_smp(); | ||
836 | return; | ||
837 | } | ||
838 | |||
839 | connect_bsp_APIC(); | 839 | connect_bsp_APIC(); |
840 | setup_local_APIC(); | 840 | setup_local_APIC(); |
841 | map_cpu_to_logical_apicid(); | 841 | map_cpu_to_logical_apicid(); |