diff options
author | Tejun Heo <tj@kernel.org> | 2011-01-23 08:37:38 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-01-28 08:54:08 -0500 |
commit | 89e5dc218e084e13a3996db6693b01478912f4ee (patch) | |
tree | d57bb72dae6677ca230602cca6a74d28cc9af3c6 /arch/x86/kernel/apic/summit_32.c | |
parent | df04cf011b0657ddc782b48d455f7e232b9be41c (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/summit_32.c')
-rw-r--r-- | arch/x86/kernel/apic/summit_32.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/arch/x86/kernel/apic/summit_32.c b/arch/x86/kernel/apic/summit_32.c index 8c9147321616..e4b8059b414a 100644 --- a/arch/x86/kernel/apic/summit_32.c +++ b/arch/x86/kernel/apic/summit_32.c | |||
@@ -239,15 +239,6 @@ static void summit_setup_apic_routing(void) | |||
239 | nr_ioapics); | 239 | nr_ioapics); |
240 | } | 240 | } |
241 | 241 | ||
242 | static int summit_apicid_to_node(int logical_apicid) | ||
243 | { | ||
244 | #ifdef CONFIG_SMP | ||
245 | return apicid_2_node[hard_smp_processor_id()]; | ||
246 | #else | ||
247 | return 0; | ||
248 | #endif | ||
249 | } | ||
250 | |||
251 | static int summit_cpu_present_to_apicid(int mps_cpu) | 242 | static int summit_cpu_present_to_apicid(int mps_cpu) |
252 | { | 243 | { |
253 | if (mps_cpu < nr_cpu_ids) | 244 | if (mps_cpu < nr_cpu_ids) |
@@ -523,7 +514,6 @@ struct apic apic_summit = { | |||
523 | .ioapic_phys_id_map = summit_ioapic_phys_id_map, | 514 | .ioapic_phys_id_map = summit_ioapic_phys_id_map, |
524 | .setup_apic_routing = summit_setup_apic_routing, | 515 | .setup_apic_routing = summit_setup_apic_routing, |
525 | .multi_timer_check = NULL, | 516 | .multi_timer_check = NULL, |
526 | .apicid_to_node = summit_apicid_to_node, | ||
527 | .cpu_present_to_apicid = summit_cpu_present_to_apicid, | 517 | .cpu_present_to_apicid = summit_cpu_present_to_apicid, |
528 | .apicid_to_cpu_present = summit_apicid_to_cpu_present, | 518 | .apicid_to_cpu_present = summit_apicid_to_cpu_present, |
529 | .setup_portio_remap = NULL, | 519 | .setup_portio_remap = NULL, |
@@ -561,4 +551,5 @@ struct apic apic_summit = { | |||
561 | .safe_wait_icr_idle = native_safe_apic_wait_icr_idle, | 551 | .safe_wait_icr_idle = native_safe_apic_wait_icr_idle, |
562 | 552 | ||
563 | .x86_32_early_logical_apicid = summit_early_logical_apicid, | 553 | .x86_32_early_logical_apicid = summit_early_logical_apicid, |
554 | .x86_32_numa_cpu_node = default_x86_32_numa_cpu_node, | ||
564 | }; | 555 | }; |