diff options
author | Glauber de Oliveira Costa <gcosta@redhat.com> | 2008-03-19 13:25:13 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-17 11:41:00 -0400 |
commit | 4780b261e2b71ca72804b26479d794839e68d9ab (patch) | |
tree | c3eb279720569985e7edb218889bd9cb7d3be4f7 /arch | |
parent | fa8004d8e0c2ba21a44bdc95c44c6c5267a991ec (diff) |
x86: isolate sanity checking
Isolate all sanity checking in a smp_sanity_check()
function as x86_64 does.
Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/smpboot_32.c | 57 |
1 files changed, 31 insertions, 26 deletions
diff --git a/arch/x86/kernel/smpboot_32.c b/arch/x86/kernel/smpboot_32.c index a232f4d1f7a5..b44a743d0ea9 100644 --- a/arch/x86/kernel/smpboot_32.c +++ b/arch/x86/kernel/smpboot_32.c | |||
@@ -735,10 +735,6 @@ exit: | |||
735 | } | 735 | } |
736 | #endif | 736 | #endif |
737 | 737 | ||
738 | /* | ||
739 | * Cycle through the processors sending APIC IPIs to boot each. | ||
740 | */ | ||
741 | |||
742 | static int boot_cpu_logical_apicid; | 738 | static int boot_cpu_logical_apicid; |
743 | /* Where the IO area was mapped on multiquad, always 0 otherwise */ | 739 | /* Where the IO area was mapped on multiquad, always 0 otherwise */ |
744 | void *xquad_portio; | 740 | void *xquad_portio; |
@@ -746,26 +742,8 @@ void *xquad_portio; | |||
746 | EXPORT_SYMBOL(xquad_portio); | 742 | EXPORT_SYMBOL(xquad_portio); |
747 | #endif | 743 | #endif |
748 | 744 | ||
749 | static void __init smp_boot_cpus(unsigned int max_cpus) | 745 | static int __init smp_sanity_check(unsigned max_cpus) |
750 | { | 746 | { |
751 | int apicid, cpu, bit, kicked; | ||
752 | unsigned long bogosum = 0; | ||
753 | |||
754 | /* | ||
755 | * Setup boot CPU information | ||
756 | */ | ||
757 | smp_store_cpu_info(0); /* Final full version of the data */ | ||
758 | printk("CPU%d: ", 0); | ||
759 | print_cpu_info(&cpu_data(0)); | ||
760 | |||
761 | boot_cpu_physical_apicid = GET_APIC_ID(apic_read(APIC_ID)); | ||
762 | boot_cpu_logical_apicid = logical_smp_processor_id(); | ||
763 | per_cpu(x86_cpu_to_apicid, 0) = boot_cpu_physical_apicid; | ||
764 | |||
765 | current_thread_info()->cpu = 0; | ||
766 | |||
767 | set_cpu_sibling_map(0); | ||
768 | |||
769 | /* | 747 | /* |
770 | * If we couldn't find an SMP configuration at boot time, | 748 | * If we couldn't find an SMP configuration at boot time, |
771 | * get out of here now! | 749 | * get out of here now! |
@@ -780,7 +758,7 @@ static void __init smp_boot_cpus(unsigned int max_cpus) | |||
780 | map_cpu_to_logical_apicid(); | 758 | map_cpu_to_logical_apicid(); |
781 | cpu_set(0, per_cpu(cpu_sibling_map, 0)); | 759 | cpu_set(0, per_cpu(cpu_sibling_map, 0)); |
782 | cpu_set(0, per_cpu(cpu_core_map, 0)); | 760 | cpu_set(0, per_cpu(cpu_core_map, 0)); |
783 | return; | 761 | return -1; |
784 | } | 762 | } |
785 | 763 | ||
786 | /* | 764 | /* |
@@ -806,7 +784,7 @@ static void __init smp_boot_cpus(unsigned int max_cpus) | |||
806 | map_cpu_to_logical_apicid(); | 784 | map_cpu_to_logical_apicid(); |
807 | cpu_set(0, per_cpu(cpu_sibling_map, 0)); | 785 | cpu_set(0, per_cpu(cpu_sibling_map, 0)); |
808 | cpu_set(0, per_cpu(cpu_core_map, 0)); | 786 | cpu_set(0, per_cpu(cpu_core_map, 0)); |
809 | return; | 787 | return -1; |
810 | } | 788 | } |
811 | 789 | ||
812 | verify_local_APIC(); | 790 | verify_local_APIC(); |
@@ -828,9 +806,36 @@ static void __init smp_boot_cpus(unsigned int max_cpus) | |||
828 | map_cpu_to_logical_apicid(); | 806 | map_cpu_to_logical_apicid(); |
829 | cpu_set(0, per_cpu(cpu_sibling_map, 0)); | 807 | cpu_set(0, per_cpu(cpu_sibling_map, 0)); |
830 | cpu_set(0, per_cpu(cpu_core_map, 0)); | 808 | cpu_set(0, per_cpu(cpu_core_map, 0)); |
831 | return; | 809 | return -1; |
832 | } | 810 | } |
811 | return 0; | ||
812 | } | ||
813 | |||
814 | |||
815 | /* | ||
816 | * Cycle through the processors sending APIC IPIs to boot each. | ||
817 | */ | ||
818 | static void __init smp_boot_cpus(unsigned int max_cpus) | ||
819 | { | ||
820 | int apicid, cpu, bit, kicked; | ||
821 | unsigned long bogosum = 0; | ||
822 | |||
823 | /* | ||
824 | * Setup boot CPU information | ||
825 | */ | ||
826 | smp_store_cpu_info(0); /* Final full version of the data */ | ||
827 | printk(KERN_INFO "CPU%d: ", 0); | ||
828 | print_cpu_info(&cpu_data(0)); | ||
829 | |||
830 | boot_cpu_physical_apicid = GET_APIC_ID(apic_read(APIC_ID)); | ||
831 | boot_cpu_logical_apicid = logical_smp_processor_id(); | ||
832 | per_cpu(x86_cpu_to_apicid, 0) = boot_cpu_physical_apicid; | ||
833 | |||
834 | current_thread_info()->cpu = 0; | ||
835 | |||
836 | set_cpu_sibling_map(0); | ||
833 | 837 | ||
838 | smp_sanity_check(max_cpus); | ||
834 | connect_bsp_APIC(); | 839 | connect_bsp_APIC(); |
835 | setup_local_APIC(); | 840 | setup_local_APIC(); |
836 | map_cpu_to_logical_apicid(); | 841 | map_cpu_to_logical_apicid(); |