diff options
Diffstat (limited to 'arch/x86/kernel/smpboot_64.c')
-rw-r--r-- | arch/x86/kernel/smpboot_64.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/arch/x86/kernel/smpboot_64.c b/arch/x86/kernel/smpboot_64.c index e351ac4ab5b1..c3e8668c5278 100644 --- a/arch/x86/kernel/smpboot_64.c +++ b/arch/x86/kernel/smpboot_64.c | |||
@@ -694,7 +694,7 @@ do_rest: | |||
694 | clear_node_cpumask(cpu); /* was set by numa_add_cpu */ | 694 | clear_node_cpumask(cpu); /* was set by numa_add_cpu */ |
695 | cpu_clear(cpu, cpu_present_map); | 695 | cpu_clear(cpu, cpu_present_map); |
696 | cpu_clear(cpu, cpu_possible_map); | 696 | cpu_clear(cpu, cpu_possible_map); |
697 | x86_cpu_to_apicid[cpu] = BAD_APICID; | 697 | per_cpu(x86_cpu_to_apicid, cpu) = BAD_APICID; |
698 | return -EIO; | 698 | return -EIO; |
699 | } | 699 | } |
700 | 700 | ||
@@ -841,6 +841,26 @@ static int __init smp_sanity_check(unsigned max_cpus) | |||
841 | } | 841 | } |
842 | 842 | ||
843 | /* | 843 | /* |
844 | * Copy apicid's found by MP_processor_info from initial array to the per cpu | ||
845 | * data area. The x86_cpu_to_apicid_init array is then expendable and the | ||
846 | * x86_cpu_to_apicid_ptr is zeroed indicating that the static array is no | ||
847 | * longer available. | ||
848 | */ | ||
849 | void __init smp_set_apicids(void) | ||
850 | { | ||
851 | int cpu; | ||
852 | |||
853 | for_each_cpu_mask(cpu, cpu_possible_map) { | ||
854 | if (per_cpu_offset(cpu)) | ||
855 | per_cpu(x86_cpu_to_apicid, cpu) = | ||
856 | x86_cpu_to_apicid_init[cpu]; | ||
857 | } | ||
858 | |||
859 | /* indicate the static array will be going away soon */ | ||
860 | x86_cpu_to_apicid_ptr = NULL; | ||
861 | } | ||
862 | |||
863 | /* | ||
844 | * Prepare for SMP bootup. The MP table or ACPI has been read | 864 | * Prepare for SMP bootup. The MP table or ACPI has been read |
845 | * earlier. Just do some sanity checking here and enable APIC mode. | 865 | * earlier. Just do some sanity checking here and enable APIC mode. |
846 | */ | 866 | */ |
@@ -849,6 +869,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
849 | nmi_watchdog_default(); | 869 | nmi_watchdog_default(); |
850 | current_cpu_data = boot_cpu_data; | 870 | current_cpu_data = boot_cpu_data; |
851 | current_thread_info()->cpu = 0; /* needed? */ | 871 | current_thread_info()->cpu = 0; /* needed? */ |
872 | smp_set_apicids(); | ||
852 | set_cpu_sibling_map(0); | 873 | set_cpu_sibling_map(0); |
853 | 874 | ||
854 | if (smp_sanity_check(max_cpus) < 0) { | 875 | if (smp_sanity_check(max_cpus) < 0) { |