aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/smpboot.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2011-01-23 08:37:31 -0500
committerIngo Molnar <mingo@elte.hu>2011-01-28 08:54:05 -0500
commit6f802c4bfa2acf1bffa8341fe9084da0205d581d (patch)
treec5b7724f18c2470cd1132145e8bd6b681abdcfed /arch/x86/kernel/smpboot.c
parent4c321ff8a01a95badf5d5403d80ca4e0ab07fce7 (diff)
x86: Always use x86_cpu_to_logical_apicid for cpu -> logical apic id
Currently, cpu -> logical apic id translation is done by apic->cpu_to_logical_apicid() callback which may or may not use x86_cpu_to_logical_apicid. This is unnecessary as it should always equal logical_smp_processor_id() which is known early during CPU bring up. Initialize x86_cpu_to_logical_apicid after apic->init_apic_ldr() in setup_local_APIC() and always use x86_cpu_to_logical_apicid for cpu -> logical apic id mapping. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: eric.dumazet@gmail.com Cc: yinghai@kernel.org Cc: brgerst@gmail.com Cc: gorcunov@gmail.com Cc: penberg@kernel.org Cc: shaohui.zheng@intel.com Cc: rientjes@google.com LKML-Reference: <1295789862-25482-6-git-send-email-tj@kernel.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/smpboot.c')
-rw-r--r--arch/x86/kernel/smpboot.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index df934e46bf53..ca20f6bee3be 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -168,19 +168,18 @@ static void unmap_cpu_to_node(int cpu)
168static void map_cpu_to_logical_apicid(void) 168static void map_cpu_to_logical_apicid(void)
169{ 169{
170 int cpu = smp_processor_id(); 170 int cpu = smp_processor_id();
171 int apicid = logical_smp_processor_id(); 171 int logical_apicid = early_per_cpu(x86_cpu_to_logical_apicid, cpu);
172 int node = apic->apicid_to_node(apicid); 172 int node;
173 173
174 node = apic->apicid_to_node(logical_apicid);
174 if (!node_online(node)) 175 if (!node_online(node))
175 node = first_online_node; 176 node = first_online_node;
176 177
177 early_per_cpu(x86_cpu_to_logical_apicid, cpu) = apicid;
178 map_cpu_to_node(cpu, node); 178 map_cpu_to_node(cpu, node);
179} 179}
180 180
181void numa_remove_cpu(int cpu) 181void numa_remove_cpu(int cpu)
182{ 182{
183 early_per_cpu(x86_cpu_to_logical_apicid, cpu) = BAD_APICID;
184 unmap_cpu_to_node(cpu); 183 unmap_cpu_to_node(cpu);
185} 184}
186#else 185#else