aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/apic/apic.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2011-01-23 08:37:38 -0500
committerIngo Molnar <mingo@elte.hu>2011-01-28 08:54:08 -0500
commit89e5dc218e084e13a3996db6693b01478912f4ee (patch)
treed57bb72dae6677ca230602cca6a74d28cc9af3c6 /arch/x86/kernel/apic/apic.c
parentdf04cf011b0657ddc782b48d455f7e232b9be41c (diff)
x86: Replace apic->apicid_to_node() with ->x86_32_numa_cpu_node()
apic->apicid_to_node() is 32bit specific apic operation which determines NUMA node for a CPU. Depending on the APIC implementation, it can be easier to determine NUMA node from either physical or logical apicid. Currently, ->apicid_to_node() takes @logical_apicid and calls hard_smp_processor_id() if the physical apicid is needed. This prevents NUMA mapping from being queried from a different CPU, which in turn makes it impossible to initialize NUMA mapping before SMP bringup. This patch replaces apic->apicid_to_node() with ->x86_32_numa_cpu_node() which takes @cpu, from which both logical and physical apicids can easily be determined. While at it, drop duplicate implementations from bigsmp_32 and summit_32, and use the default one. Signed-off-by: Tejun Heo <tj@kernel.org> Reviewed-by: Pekka Enberg <penberg@kernel.org> Cc: eric.dumazet@gmail.com Cc: yinghai@kernel.org Cc: brgerst@gmail.com Cc: gorcunov@gmail.com Cc: shaohui.zheng@intel.com Cc: rientjes@google.com LKML-Reference: <1295789862-25482-13-git-send-email-tj@kernel.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/apic/apic.c')
-rw-r--r--arch/x86/kernel/apic/apic.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 3127079628e8..0f4f3c152311 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -2020,10 +2020,14 @@ void default_init_apic_ldr(void)
2020} 2020}
2021 2021
2022#ifdef CONFIG_X86_32 2022#ifdef CONFIG_X86_32
2023int default_apicid_to_node(int logical_apicid) 2023int default_x86_32_numa_cpu_node(int cpu)
2024{ 2024{
2025#ifdef CONFIG_SMP 2025#ifdef CONFIG_NUMA
2026 return apicid_2_node[hard_smp_processor_id()]; 2026 int apicid = early_per_cpu(x86_cpu_to_apicid, cpu);
2027
2028 if (apicid != BAD_APICID)
2029 return apicid_2_node[apicid];
2030 return NUMA_NO_NODE;
2027#else 2031#else
2028 return 0; 2032 return 0;
2029#endif 2033#endif