diff options
author | Glauber de Oliveira Costa <gcosta@redhat.com> | 2008-03-19 13:25:43 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-17 11:41:02 -0400 |
commit | 9713277607f9eac7d655c6854dd92bc2ce1b6f02 (patch) | |
tree | b78b775a130105c59382b5d03b526303081f8a7c | |
parent | d2bcbad5f3ad38a1c09861bca7e252dde7bb8259 (diff) |
x86: boot cpus from cpu_up, instead of prepare_cpus
After all the infrastructure work, we're now prepared
to boot the cpus from cpu_up, and not from prepare_cpus.
So the difference between cold boot and hotplug is effectively
over, and the functions are used to the purposes they're meant to.
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 | 48 |
1 files changed, 2 insertions, 46 deletions
diff --git a/arch/x86/kernel/smpboot_32.c b/arch/x86/kernel/smpboot_32.c index 88ee65585d3f..978e13708ddb 100644 --- a/arch/x86/kernel/smpboot_32.c +++ b/arch/x86/kernel/smpboot_32.c | |||
@@ -670,6 +670,7 @@ void cpu_exit_clear(void) | |||
670 | cpu_clear(cpu, smp_commenced_mask); | 670 | cpu_clear(cpu, smp_commenced_mask); |
671 | unmap_cpu_to_logical_apicid(cpu); | 671 | unmap_cpu_to_logical_apicid(cpu); |
672 | } | 672 | } |
673 | #endif | ||
673 | 674 | ||
674 | struct warm_boot_cpu_info { | 675 | struct warm_boot_cpu_info { |
675 | struct completion *complete; | 676 | struct completion *complete; |
@@ -710,7 +711,6 @@ static void __cpuinit __smp_prepare_cpu(int cpu) | |||
710 | wait_for_completion(&done); | 711 | wait_for_completion(&done); |
711 | } | 712 | } |
712 | } | 713 | } |
713 | #endif | ||
714 | 714 | ||
715 | static int boot_cpu_logical_apicid; | 715 | static int boot_cpu_logical_apicid; |
716 | /* Where the IO area was mapped on multiquad, always 0 otherwise */ | 716 | /* Where the IO area was mapped on multiquad, always 0 otherwise */ |
@@ -790,8 +790,6 @@ static int __init smp_sanity_check(unsigned max_cpus) | |||
790 | */ | 790 | */ |
791 | static void __init smp_boot_cpus(unsigned int max_cpus) | 791 | static void __init smp_boot_cpus(unsigned int max_cpus) |
792 | { | 792 | { |
793 | int apicid, cpu, bit, kicked; | ||
794 | |||
795 | /* | 793 | /* |
796 | * Setup boot CPU information | 794 | * Setup boot CPU information |
797 | */ | 795 | */ |
@@ -819,39 +817,6 @@ static void __init smp_boot_cpus(unsigned int max_cpus) | |||
819 | 817 | ||
820 | setup_portio_remap(); | 818 | setup_portio_remap(); |
821 | 819 | ||
822 | /* | ||
823 | * Scan the CPU present map and fire up the other CPUs via do_boot_cpu | ||
824 | * | ||
825 | * In clustered apic mode, phys_cpu_present_map is a constructed thus: | ||
826 | * bits 0-3 are quad0, 4-7 are quad1, etc. A perverse twist on the | ||
827 | * clustered apic ID. | ||
828 | */ | ||
829 | Dprintk("CPU present map: %lx\n", physids_coerce(phys_cpu_present_map)); | ||
830 | |||
831 | kicked = 1; | ||
832 | for (bit = 0; kicked < NR_CPUS && bit < MAX_APICS; bit++) { | ||
833 | apicid = cpu_present_to_apicid(bit); | ||
834 | /* | ||
835 | * Don't even attempt to start the boot CPU! | ||
836 | */ | ||
837 | if ((apicid == boot_cpu_apicid) || (apicid == BAD_APICID)) | ||
838 | continue; | ||
839 | |||
840 | if (!check_apicid_present(bit)) | ||
841 | continue; | ||
842 | if (max_cpus <= cpus_weight(cpu_present_map)) | ||
843 | continue; | ||
844 | /* Utterly temporary */ | ||
845 | for (cpu = 0; cpu < NR_CPUS; cpu++) | ||
846 | if (per_cpu(x86_cpu_to_apicid, cpu) == apicid) | ||
847 | break; | ||
848 | if (do_boot_cpu(apicid, cpu)) | ||
849 | printk("CPU #%d not responding - cannot use it.\n", | ||
850 | apicid); | ||
851 | else | ||
852 | ++kicked; | ||
853 | } | ||
854 | |||
855 | smpboot_setup_io_apic(); | 820 | smpboot_setup_io_apic(); |
856 | 821 | ||
857 | setup_boot_clock(); | 822 | setup_boot_clock(); |
@@ -895,17 +860,8 @@ int __cpuinit native_cpu_up(unsigned int cpu) | |||
895 | } | 860 | } |
896 | 861 | ||
897 | per_cpu(cpu_state, cpu) = CPU_UP_PREPARE; | 862 | per_cpu(cpu_state, cpu) = CPU_UP_PREPARE; |
898 | #ifdef CONFIG_HOTPLUG_CPU | ||
899 | 863 | ||
900 | /* | 864 | __smp_prepare_cpu(cpu); |
901 | * We do warm boot only on cpus that had booted earlier | ||
902 | * Otherwise cold boot is all handled from smp_boot_cpus(). | ||
903 | * cpu_callin_map is set during AP kickstart process. Its reset | ||
904 | * when a cpu is taken offline from cpu_exit_clear(). | ||
905 | */ | ||
906 | if (!cpu_isset(cpu, cpu_callin_map)) | ||
907 | __smp_prepare_cpu(cpu); | ||
908 | #endif | ||
909 | 865 | ||
910 | /* In case one didn't come up */ | 866 | /* In case one didn't come up */ |
911 | if (!cpu_isset(cpu, cpu_callin_map)) { | 867 | if (!cpu_isset(cpu, cpu_callin_map)) { |