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 | |
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>
-rw-r--r-- | arch/x86/include/asm/apic.h | 6 | ||||
-rw-r--r-- | arch/x86/kernel/apic/apic.c | 10 | ||||
-rw-r--r-- | arch/x86/kernel/apic/apic_flat_64.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/apic/apic_noop.c | 16 | ||||
-rw-r--r-- | arch/x86/kernel/apic/bigsmp_32.c | 7 | ||||
-rw-r--r-- | arch/x86/kernel/apic/es7000_32.c | 7 | ||||
-rw-r--r-- | arch/x86/kernel/apic/numaq_32.c | 11 | ||||
-rw-r--r-- | arch/x86/kernel/apic/probe_32.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/apic/summit_32.c | 11 | ||||
-rw-r--r-- | arch/x86/kernel/apic/x2apic_cluster.c | 1 | ||||
-rw-r--r-- | arch/x86/kernel/apic/x2apic_phys.c | 1 | ||||
-rw-r--r-- | arch/x86/kernel/apic/x2apic_uv_x.c | 1 | ||||
-rw-r--r-- | arch/x86/kernel/smpboot.c | 3 |
13 files changed, 37 insertions, 41 deletions
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h index efb073b5c743..ad30ca4b6fe9 100644 --- a/arch/x86/include/asm/apic.h +++ b/arch/x86/include/asm/apic.h | |||
@@ -306,7 +306,6 @@ struct apic { | |||
306 | 306 | ||
307 | void (*setup_apic_routing)(void); | 307 | void (*setup_apic_routing)(void); |
308 | int (*multi_timer_check)(int apic, int irq); | 308 | int (*multi_timer_check)(int apic, int irq); |
309 | int (*apicid_to_node)(int logical_apicid); | ||
310 | int (*cpu_present_to_apicid)(int mps_cpu); | 309 | int (*cpu_present_to_apicid)(int mps_cpu); |
311 | void (*apicid_to_cpu_present)(int phys_apicid, physid_mask_t *retmap); | 310 | void (*apicid_to_cpu_present)(int phys_apicid, physid_mask_t *retmap); |
312 | void (*setup_portio_remap)(void); | 311 | void (*setup_portio_remap)(void); |
@@ -367,6 +366,9 @@ struct apic { | |||
367 | * won't be applied properly during early boot in this case. | 366 | * won't be applied properly during early boot in this case. |
368 | */ | 367 | */ |
369 | int (*x86_32_early_logical_apicid)(int cpu); | 368 | int (*x86_32_early_logical_apicid)(int cpu); |
369 | |||
370 | /* determine CPU -> NUMA node mapping */ | ||
371 | int (*x86_32_numa_cpu_node)(int cpu); | ||
370 | #endif | 372 | #endif |
371 | }; | 373 | }; |
372 | 374 | ||
@@ -539,7 +541,7 @@ static inline int default_phys_pkg_id(int cpuid_apic, int index_msb) | |||
539 | return cpuid_apic >> index_msb; | 541 | return cpuid_apic >> index_msb; |
540 | } | 542 | } |
541 | 543 | ||
542 | extern int default_apicid_to_node(int logical_apicid); | 544 | extern int default_x86_32_numa_cpu_node(int cpu); |
543 | 545 | ||
544 | #endif | 546 | #endif |
545 | 547 | ||
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 |
2023 | int default_apicid_to_node(int logical_apicid) | 2023 | int 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 |
diff --git a/arch/x86/kernel/apic/apic_flat_64.c b/arch/x86/kernel/apic/apic_flat_64.c index 5a9d11a94b55..5652d31fe108 100644 --- a/arch/x86/kernel/apic/apic_flat_64.c +++ b/arch/x86/kernel/apic/apic_flat_64.c | |||
@@ -185,7 +185,6 @@ struct apic apic_flat = { | |||
185 | .ioapic_phys_id_map = NULL, | 185 | .ioapic_phys_id_map = NULL, |
186 | .setup_apic_routing = NULL, | 186 | .setup_apic_routing = NULL, |
187 | .multi_timer_check = NULL, | 187 | .multi_timer_check = NULL, |
188 | .apicid_to_node = NULL, | ||
189 | .cpu_present_to_apicid = default_cpu_present_to_apicid, | 188 | .cpu_present_to_apicid = default_cpu_present_to_apicid, |
190 | .apicid_to_cpu_present = NULL, | 189 | .apicid_to_cpu_present = NULL, |
191 | .setup_portio_remap = NULL, | 190 | .setup_portio_remap = NULL, |
@@ -336,7 +335,6 @@ struct apic apic_physflat = { | |||
336 | .ioapic_phys_id_map = NULL, | 335 | .ioapic_phys_id_map = NULL, |
337 | .setup_apic_routing = NULL, | 336 | .setup_apic_routing = NULL, |
338 | .multi_timer_check = NULL, | 337 | .multi_timer_check = NULL, |
339 | .apicid_to_node = NULL, | ||
340 | .cpu_present_to_apicid = default_cpu_present_to_apicid, | 338 | .cpu_present_to_apicid = default_cpu_present_to_apicid, |
341 | .apicid_to_cpu_present = NULL, | 339 | .apicid_to_cpu_present = NULL, |
342 | .setup_portio_remap = NULL, | 340 | .setup_portio_remap = NULL, |
diff --git a/arch/x86/kernel/apic/apic_noop.c b/arch/x86/kernel/apic/apic_noop.c index 0309c58d96bc..f1baa2dc087a 100644 --- a/arch/x86/kernel/apic/apic_noop.c +++ b/arch/x86/kernel/apic/apic_noop.c | |||
@@ -108,12 +108,6 @@ static void noop_vector_allocation_domain(int cpu, struct cpumask *retmask) | |||
108 | cpumask_set_cpu(cpu, retmask); | 108 | cpumask_set_cpu(cpu, retmask); |
109 | } | 109 | } |
110 | 110 | ||
111 | int noop_apicid_to_node(int logical_apicid) | ||
112 | { | ||
113 | /* we're always on node 0 */ | ||
114 | return 0; | ||
115 | } | ||
116 | |||
117 | static u32 noop_apic_read(u32 reg) | 111 | static u32 noop_apic_read(u32 reg) |
118 | { | 112 | { |
119 | WARN_ON_ONCE((cpu_has_apic && !disable_apic)); | 113 | WARN_ON_ONCE((cpu_has_apic && !disable_apic)); |
@@ -125,6 +119,14 @@ static void noop_apic_write(u32 reg, u32 v) | |||
125 | WARN_ON_ONCE(cpu_has_apic && !disable_apic); | 119 | WARN_ON_ONCE(cpu_has_apic && !disable_apic); |
126 | } | 120 | } |
127 | 121 | ||
122 | #ifdef CONFIG_X86_32 | ||
123 | static int noop_x86_32_numa_cpu_node(int cpu) | ||
124 | { | ||
125 | /* we're always on node 0 */ | ||
126 | return 0; | ||
127 | } | ||
128 | #endif | ||
129 | |||
128 | struct apic apic_noop = { | 130 | struct apic apic_noop = { |
129 | .name = "noop", | 131 | .name = "noop", |
130 | .probe = noop_probe, | 132 | .probe = noop_probe, |
@@ -148,7 +150,6 @@ struct apic apic_noop = { | |||
148 | .ioapic_phys_id_map = default_ioapic_phys_id_map, | 150 | .ioapic_phys_id_map = default_ioapic_phys_id_map, |
149 | .setup_apic_routing = NULL, | 151 | .setup_apic_routing = NULL, |
150 | .multi_timer_check = NULL, | 152 | .multi_timer_check = NULL, |
151 | .apicid_to_node = noop_apicid_to_node, | ||
152 | 153 | ||
153 | .cpu_present_to_apicid = default_cpu_present_to_apicid, | 154 | .cpu_present_to_apicid = default_cpu_present_to_apicid, |
154 | .apicid_to_cpu_present = physid_set_mask_of_physid, | 155 | .apicid_to_cpu_present = physid_set_mask_of_physid, |
@@ -194,5 +195,6 @@ struct apic apic_noop = { | |||
194 | 195 | ||
195 | #ifdef CONFIG_X86_32 | 196 | #ifdef CONFIG_X86_32 |
196 | .x86_32_early_logical_apicid = noop_x86_32_early_logical_apicid, | 197 | .x86_32_early_logical_apicid = noop_x86_32_early_logical_apicid, |
198 | .x86_32_numa_cpu_node = noop_x86_32_numa_cpu_node, | ||
197 | #endif | 199 | #endif |
198 | }; | 200 | }; |
diff --git a/arch/x86/kernel/apic/bigsmp_32.c b/arch/x86/kernel/apic/bigsmp_32.c index bc7ed040bb0e..541a2e431659 100644 --- a/arch/x86/kernel/apic/bigsmp_32.c +++ b/arch/x86/kernel/apic/bigsmp_32.c | |||
@@ -86,11 +86,6 @@ static void bigsmp_setup_apic_routing(void) | |||
86 | nr_ioapics); | 86 | nr_ioapics); |
87 | } | 87 | } |
88 | 88 | ||
89 | static int bigsmp_apicid_to_node(int logical_apicid) | ||
90 | { | ||
91 | return apicid_2_node[hard_smp_processor_id()]; | ||
92 | } | ||
93 | |||
94 | static int bigsmp_cpu_present_to_apicid(int mps_cpu) | 89 | static int bigsmp_cpu_present_to_apicid(int mps_cpu) |
95 | { | 90 | { |
96 | if (mps_cpu < nr_cpu_ids) | 91 | if (mps_cpu < nr_cpu_ids) |
@@ -221,7 +216,6 @@ struct apic apic_bigsmp = { | |||
221 | .ioapic_phys_id_map = bigsmp_ioapic_phys_id_map, | 216 | .ioapic_phys_id_map = bigsmp_ioapic_phys_id_map, |
222 | .setup_apic_routing = bigsmp_setup_apic_routing, | 217 | .setup_apic_routing = bigsmp_setup_apic_routing, |
223 | .multi_timer_check = NULL, | 218 | .multi_timer_check = NULL, |
224 | .apicid_to_node = bigsmp_apicid_to_node, | ||
225 | .cpu_present_to_apicid = bigsmp_cpu_present_to_apicid, | 219 | .cpu_present_to_apicid = bigsmp_cpu_present_to_apicid, |
226 | .apicid_to_cpu_present = physid_set_mask_of_physid, | 220 | .apicid_to_cpu_present = physid_set_mask_of_physid, |
227 | .setup_portio_remap = NULL, | 221 | .setup_portio_remap = NULL, |
@@ -259,4 +253,5 @@ struct apic apic_bigsmp = { | |||
259 | .safe_wait_icr_idle = native_safe_apic_wait_icr_idle, | 253 | .safe_wait_icr_idle = native_safe_apic_wait_icr_idle, |
260 | 254 | ||
261 | .x86_32_early_logical_apicid = bigsmp_early_logical_apicid, | 255 | .x86_32_early_logical_apicid = bigsmp_early_logical_apicid, |
256 | .x86_32_numa_cpu_node = default_x86_32_numa_cpu_node, | ||
262 | }; | 257 | }; |
diff --git a/arch/x86/kernel/apic/es7000_32.c b/arch/x86/kernel/apic/es7000_32.c index 5c53d053ada5..3e9de4854c5b 100644 --- a/arch/x86/kernel/apic/es7000_32.c +++ b/arch/x86/kernel/apic/es7000_32.c | |||
@@ -510,12 +510,11 @@ static void es7000_setup_apic_routing(void) | |||
510 | nr_ioapics, cpumask_bits(es7000_target_cpus())[0]); | 510 | nr_ioapics, cpumask_bits(es7000_target_cpus())[0]); |
511 | } | 511 | } |
512 | 512 | ||
513 | static int es7000_apicid_to_node(int logical_apicid) | 513 | static int es7000_numa_cpu_node(int cpu) |
514 | { | 514 | { |
515 | return 0; | 515 | return 0; |
516 | } | 516 | } |
517 | 517 | ||
518 | |||
519 | static int es7000_cpu_present_to_apicid(int mps_cpu) | 518 | static int es7000_cpu_present_to_apicid(int mps_cpu) |
520 | { | 519 | { |
521 | if (!mps_cpu) | 520 | if (!mps_cpu) |
@@ -649,7 +648,6 @@ struct apic __refdata apic_es7000_cluster = { | |||
649 | .ioapic_phys_id_map = es7000_ioapic_phys_id_map, | 648 | .ioapic_phys_id_map = es7000_ioapic_phys_id_map, |
650 | .setup_apic_routing = es7000_setup_apic_routing, | 649 | .setup_apic_routing = es7000_setup_apic_routing, |
651 | .multi_timer_check = NULL, | 650 | .multi_timer_check = NULL, |
652 | .apicid_to_node = es7000_apicid_to_node, | ||
653 | .cpu_present_to_apicid = es7000_cpu_present_to_apicid, | 651 | .cpu_present_to_apicid = es7000_cpu_present_to_apicid, |
654 | .apicid_to_cpu_present = es7000_apicid_to_cpu_present, | 652 | .apicid_to_cpu_present = es7000_apicid_to_cpu_present, |
655 | .setup_portio_remap = NULL, | 653 | .setup_portio_remap = NULL, |
@@ -690,6 +688,7 @@ struct apic __refdata apic_es7000_cluster = { | |||
690 | .safe_wait_icr_idle = native_safe_apic_wait_icr_idle, | 688 | .safe_wait_icr_idle = native_safe_apic_wait_icr_idle, |
691 | 689 | ||
692 | .x86_32_early_logical_apicid = es7000_early_logical_apicid, | 690 | .x86_32_early_logical_apicid = es7000_early_logical_apicid, |
691 | .x86_32_numa_cpu_node = es7000_numa_cpu_node, | ||
693 | }; | 692 | }; |
694 | 693 | ||
695 | struct apic __refdata apic_es7000 = { | 694 | struct apic __refdata apic_es7000 = { |
@@ -715,7 +714,6 @@ struct apic __refdata apic_es7000 = { | |||
715 | .ioapic_phys_id_map = es7000_ioapic_phys_id_map, | 714 | .ioapic_phys_id_map = es7000_ioapic_phys_id_map, |
716 | .setup_apic_routing = es7000_setup_apic_routing, | 715 | .setup_apic_routing = es7000_setup_apic_routing, |
717 | .multi_timer_check = NULL, | 716 | .multi_timer_check = NULL, |
718 | .apicid_to_node = es7000_apicid_to_node, | ||
719 | .cpu_present_to_apicid = es7000_cpu_present_to_apicid, | 717 | .cpu_present_to_apicid = es7000_cpu_present_to_apicid, |
720 | .apicid_to_cpu_present = es7000_apicid_to_cpu_present, | 718 | .apicid_to_cpu_present = es7000_apicid_to_cpu_present, |
721 | .setup_portio_remap = NULL, | 719 | .setup_portio_remap = NULL, |
@@ -754,4 +752,5 @@ struct apic __refdata apic_es7000 = { | |||
754 | .safe_wait_icr_idle = native_safe_apic_wait_icr_idle, | 752 | .safe_wait_icr_idle = native_safe_apic_wait_icr_idle, |
755 | 753 | ||
756 | .x86_32_early_logical_apicid = es7000_early_logical_apicid, | 754 | .x86_32_early_logical_apicid = es7000_early_logical_apicid, |
755 | .x86_32_numa_cpu_node = es7000_numa_cpu_node, | ||
757 | }; | 756 | }; |
diff --git a/arch/x86/kernel/apic/numaq_32.c b/arch/x86/kernel/apic/numaq_32.c index f1a8b120c49d..6273eee5134b 100644 --- a/arch/x86/kernel/apic/numaq_32.c +++ b/arch/x86/kernel/apic/numaq_32.c | |||
@@ -391,6 +391,15 @@ static inline int numaq_apicid_to_node(int logical_apicid) | |||
391 | return logical_apicid >> 4; | 391 | return logical_apicid >> 4; |
392 | } | 392 | } |
393 | 393 | ||
394 | static int numaq_numa_cpu_node(int cpu) | ||
395 | { | ||
396 | int logical_apicid = early_per_cpu(x86_cpu_to_logical_apicid, cpu); | ||
397 | |||
398 | if (logical_apicid != BAD_APICID) | ||
399 | return numaq_apicid_to_node(logical_apicid); | ||
400 | return NUMA_NO_NODE; | ||
401 | } | ||
402 | |||
394 | static void numaq_apicid_to_cpu_present(int logical_apicid, physid_mask_t *retmap) | 403 | static void numaq_apicid_to_cpu_present(int logical_apicid, physid_mask_t *retmap) |
395 | { | 404 | { |
396 | int node = numaq_apicid_to_node(logical_apicid); | 405 | int node = numaq_apicid_to_node(logical_apicid); |
@@ -501,7 +510,6 @@ struct apic __refdata apic_numaq = { | |||
501 | .ioapic_phys_id_map = numaq_ioapic_phys_id_map, | 510 | .ioapic_phys_id_map = numaq_ioapic_phys_id_map, |
502 | .setup_apic_routing = numaq_setup_apic_routing, | 511 | .setup_apic_routing = numaq_setup_apic_routing, |
503 | .multi_timer_check = numaq_multi_timer_check, | 512 | .multi_timer_check = numaq_multi_timer_check, |
504 | .apicid_to_node = numaq_apicid_to_node, | ||
505 | .cpu_present_to_apicid = numaq_cpu_present_to_apicid, | 513 | .cpu_present_to_apicid = numaq_cpu_present_to_apicid, |
506 | .apicid_to_cpu_present = numaq_apicid_to_cpu_present, | 514 | .apicid_to_cpu_present = numaq_apicid_to_cpu_present, |
507 | .setup_portio_remap = numaq_setup_portio_remap, | 515 | .setup_portio_remap = numaq_setup_portio_remap, |
@@ -541,4 +549,5 @@ struct apic __refdata apic_numaq = { | |||
541 | .safe_wait_icr_idle = native_safe_apic_wait_icr_idle, | 549 | .safe_wait_icr_idle = native_safe_apic_wait_icr_idle, |
542 | 550 | ||
543 | .x86_32_early_logical_apicid = noop_x86_32_early_logical_apicid, | 551 | .x86_32_early_logical_apicid = noop_x86_32_early_logical_apicid, |
552 | .x86_32_numa_cpu_node = numaq_numa_cpu_node, | ||
544 | }; | 553 | }; |
diff --git a/arch/x86/kernel/apic/probe_32.c b/arch/x86/kernel/apic/probe_32.c index 0f9a9ab49e79..fc84c7b61108 100644 --- a/arch/x86/kernel/apic/probe_32.c +++ b/arch/x86/kernel/apic/probe_32.c | |||
@@ -135,7 +135,6 @@ struct apic apic_default = { | |||
135 | .ioapic_phys_id_map = default_ioapic_phys_id_map, | 135 | .ioapic_phys_id_map = default_ioapic_phys_id_map, |
136 | .setup_apic_routing = setup_apic_flat_routing, | 136 | .setup_apic_routing = setup_apic_flat_routing, |
137 | .multi_timer_check = NULL, | 137 | .multi_timer_check = NULL, |
138 | .apicid_to_node = default_apicid_to_node, | ||
139 | .cpu_present_to_apicid = default_cpu_present_to_apicid, | 138 | .cpu_present_to_apicid = default_cpu_present_to_apicid, |
140 | .apicid_to_cpu_present = physid_set_mask_of_physid, | 139 | .apicid_to_cpu_present = physid_set_mask_of_physid, |
141 | .setup_portio_remap = NULL, | 140 | .setup_portio_remap = NULL, |
@@ -173,6 +172,7 @@ struct apic apic_default = { | |||
173 | .safe_wait_icr_idle = native_safe_apic_wait_icr_idle, | 172 | .safe_wait_icr_idle = native_safe_apic_wait_icr_idle, |
174 | 173 | ||
175 | .x86_32_early_logical_apicid = default_x86_32_early_logical_apicid, | 174 | .x86_32_early_logical_apicid = default_x86_32_early_logical_apicid, |
175 | .x86_32_numa_cpu_node = default_x86_32_numa_cpu_node, | ||
176 | }; | 176 | }; |
177 | 177 | ||
178 | extern struct apic apic_numaq; | 178 | extern struct apic apic_numaq; |
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 | }; |
diff --git a/arch/x86/kernel/apic/x2apic_cluster.c b/arch/x86/kernel/apic/x2apic_cluster.c index badc1fdbea27..90949bbd566d 100644 --- a/arch/x86/kernel/apic/x2apic_cluster.c +++ b/arch/x86/kernel/apic/x2apic_cluster.c | |||
@@ -206,7 +206,6 @@ struct apic apic_x2apic_cluster = { | |||
206 | .ioapic_phys_id_map = NULL, | 206 | .ioapic_phys_id_map = NULL, |
207 | .setup_apic_routing = NULL, | 207 | .setup_apic_routing = NULL, |
208 | .multi_timer_check = NULL, | 208 | .multi_timer_check = NULL, |
209 | .apicid_to_node = NULL, | ||
210 | .cpu_present_to_apicid = default_cpu_present_to_apicid, | 209 | .cpu_present_to_apicid = default_cpu_present_to_apicid, |
211 | .apicid_to_cpu_present = NULL, | 210 | .apicid_to_cpu_present = NULL, |
212 | .setup_portio_remap = NULL, | 211 | .setup_portio_remap = NULL, |
diff --git a/arch/x86/kernel/apic/x2apic_phys.c b/arch/x86/kernel/apic/x2apic_phys.c index f28bf4c5faf2..c7e6d6645bf4 100644 --- a/arch/x86/kernel/apic/x2apic_phys.c +++ b/arch/x86/kernel/apic/x2apic_phys.c | |||
@@ -195,7 +195,6 @@ struct apic apic_x2apic_phys = { | |||
195 | .ioapic_phys_id_map = NULL, | 195 | .ioapic_phys_id_map = NULL, |
196 | .setup_apic_routing = NULL, | 196 | .setup_apic_routing = NULL, |
197 | .multi_timer_check = NULL, | 197 | .multi_timer_check = NULL, |
198 | .apicid_to_node = NULL, | ||
199 | .cpu_present_to_apicid = default_cpu_present_to_apicid, | 198 | .cpu_present_to_apicid = default_cpu_present_to_apicid, |
200 | .apicid_to_cpu_present = NULL, | 199 | .apicid_to_cpu_present = NULL, |
201 | .setup_portio_remap = NULL, | 200 | .setup_portio_remap = NULL, |
diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c index 60276206b725..3c289281394c 100644 --- a/arch/x86/kernel/apic/x2apic_uv_x.c +++ b/arch/x86/kernel/apic/x2apic_uv_x.c | |||
@@ -338,7 +338,6 @@ struct apic __refdata apic_x2apic_uv_x = { | |||
338 | .ioapic_phys_id_map = NULL, | 338 | .ioapic_phys_id_map = NULL, |
339 | .setup_apic_routing = NULL, | 339 | .setup_apic_routing = NULL, |
340 | .multi_timer_check = NULL, | 340 | .multi_timer_check = NULL, |
341 | .apicid_to_node = NULL, | ||
342 | .cpu_present_to_apicid = default_cpu_present_to_apicid, | 341 | .cpu_present_to_apicid = default_cpu_present_to_apicid, |
343 | .apicid_to_cpu_present = NULL, | 342 | .apicid_to_cpu_present = NULL, |
344 | .setup_portio_remap = NULL, | 343 | .setup_portio_remap = NULL, |
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index ca20f6bee3be..5319cdd53765 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c | |||
@@ -168,10 +168,9 @@ static void unmap_cpu_to_node(int cpu) | |||
168 | static void map_cpu_to_logical_apicid(void) | 168 | static void map_cpu_to_logical_apicid(void) |
169 | { | 169 | { |
170 | int cpu = smp_processor_id(); | 170 | int cpu = smp_processor_id(); |
171 | int logical_apicid = early_per_cpu(x86_cpu_to_logical_apicid, cpu); | ||
172 | int node; | 171 | int node; |
173 | 172 | ||
174 | node = apic->apicid_to_node(logical_apicid); | 173 | node = apic->x86_32_numa_cpu_node(cpu); |
175 | if (!node_online(node)) | 174 | if (!node_online(node)) |
176 | node = first_online_node; | 175 | node = first_online_node; |
177 | 176 | ||