diff options
Diffstat (limited to 'arch/x86/kernel/smpboot_32.c')
-rw-r--r-- | arch/x86/kernel/smpboot_32.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/arch/x86/kernel/smpboot_32.c b/arch/x86/kernel/smpboot_32.c index 65e5de7d64db..631be36ec2a9 100644 --- a/arch/x86/kernel/smpboot_32.c +++ b/arch/x86/kernel/smpboot_32.c | |||
@@ -92,9 +92,17 @@ static cpumask_t smp_commenced_mask; | |||
92 | struct cpuinfo_x86 cpu_data[NR_CPUS] __cacheline_aligned; | 92 | struct cpuinfo_x86 cpu_data[NR_CPUS] __cacheline_aligned; |
93 | EXPORT_SYMBOL(cpu_data); | 93 | EXPORT_SYMBOL(cpu_data); |
94 | 94 | ||
95 | u8 x86_cpu_to_apicid[NR_CPUS] __read_mostly = | 95 | /* |
96 | { [0 ... NR_CPUS-1] = 0xff }; | 96 | * The following static array is used during kernel startup |
97 | EXPORT_SYMBOL(x86_cpu_to_apicid); | 97 | * and the x86_cpu_to_apicid_ptr contains the address of the |
98 | * array during this time. Is it zeroed when the per_cpu | ||
99 | * data area is removed. | ||
100 | */ | ||
101 | u8 x86_cpu_to_apicid_init[NR_CPUS] __initdata = | ||
102 | { [0 ... NR_CPUS-1] = BAD_APICID }; | ||
103 | void *x86_cpu_to_apicid_ptr; | ||
104 | DEFINE_PER_CPU(u8, x86_cpu_to_apicid) = BAD_APICID; | ||
105 | EXPORT_PER_CPU_SYMBOL(x86_cpu_to_apicid); | ||
98 | 106 | ||
99 | u8 apicid_2_node[MAX_APICID]; | 107 | u8 apicid_2_node[MAX_APICID]; |
100 | 108 | ||
@@ -804,7 +812,7 @@ static int __cpuinit do_boot_cpu(int apicid, int cpu) | |||
804 | 812 | ||
805 | irq_ctx_init(cpu); | 813 | irq_ctx_init(cpu); |
806 | 814 | ||
807 | x86_cpu_to_apicid[cpu] = apicid; | 815 | per_cpu(x86_cpu_to_apicid, cpu) = apicid; |
808 | /* | 816 | /* |
809 | * This grunge runs the startup process for | 817 | * This grunge runs the startup process for |
810 | * the targeted processor. | 818 | * the targeted processor. |
@@ -866,7 +874,7 @@ static int __cpuinit do_boot_cpu(int apicid, int cpu) | |||
866 | cpu_clear(cpu, cpu_initialized); /* was set by cpu_init() */ | 874 | cpu_clear(cpu, cpu_initialized); /* was set by cpu_init() */ |
867 | cpucount--; | 875 | cpucount--; |
868 | } else { | 876 | } else { |
869 | x86_cpu_to_apicid[cpu] = apicid; | 877 | per_cpu(x86_cpu_to_apicid, cpu) = apicid; |
870 | cpu_set(cpu, cpu_present_map); | 878 | cpu_set(cpu, cpu_present_map); |
871 | } | 879 | } |
872 | 880 | ||
@@ -915,7 +923,7 @@ static int __cpuinit __smp_prepare_cpu(int cpu) | |||
915 | struct warm_boot_cpu_info info; | 923 | struct warm_boot_cpu_info info; |
916 | int apicid, ret; | 924 | int apicid, ret; |
917 | 925 | ||
918 | apicid = x86_cpu_to_apicid[cpu]; | 926 | apicid = per_cpu(x86_cpu_to_apicid, cpu); |
919 | if (apicid == BAD_APICID) { | 927 | if (apicid == BAD_APICID) { |
920 | ret = -ENODEV; | 928 | ret = -ENODEV; |
921 | goto exit; | 929 | goto exit; |
@@ -965,7 +973,7 @@ static void __init smp_boot_cpus(unsigned int max_cpus) | |||
965 | 973 | ||
966 | boot_cpu_physical_apicid = GET_APIC_ID(apic_read(APIC_ID)); | 974 | boot_cpu_physical_apicid = GET_APIC_ID(apic_read(APIC_ID)); |
967 | boot_cpu_logical_apicid = logical_smp_processor_id(); | 975 | boot_cpu_logical_apicid = logical_smp_processor_id(); |
968 | x86_cpu_to_apicid[0] = boot_cpu_physical_apicid; | 976 | per_cpu(x86_cpu_to_apicid, 0) = boot_cpu_physical_apicid; |
969 | 977 | ||
970 | current_thread_info()->cpu = 0; | 978 | current_thread_info()->cpu = 0; |
971 | 979 | ||