aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm/amdtopology_64.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2011-02-16 06:13:07 -0500
committerTejun Heo <tj@kernel.org>2011-02-16 06:13:07 -0500
commit206e42087a037fa3adca8908fd318a0cb64d4dee (patch)
tree044cc262b03c62064a65d13b119b6f73da5c22f4 /arch/x86/mm/amdtopology_64.c
parent45fe6c78c4ccc384044d1b4877eebe7acf359e76 (diff)
x86-64, NUMA: Use common numa_nodes[]
ACPI and amd are using separate nodes[] array. Add numa_nodes[] and use them in all NUMA init methods. cutoff_node() cleanup is moved from srat_64.c to numa_64.c and applied in initmem_init() regardless of init methods. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Yinghai Lu <yinghai@kernel.org> Cc: Brian Gerst <brgerst@gmail.com> Cc: Cyrill Gorcunov <gorcunov@gmail.com> Cc: Shaohui Zheng <shaohui.zheng@intel.com> Cc: David Rientjes <rientjes@google.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/x86/mm/amdtopology_64.c')
-rw-r--r--arch/x86/mm/amdtopology_64.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/arch/x86/mm/amdtopology_64.c b/arch/x86/mm/amdtopology_64.c
index b6029a6b129..f049fa67ed7 100644
--- a/arch/x86/mm/amdtopology_64.c
+++ b/arch/x86/mm/amdtopology_64.c
@@ -26,7 +26,6 @@
26#include <asm/apic.h> 26#include <asm/apic.h>
27#include <asm/amd_nb.h> 27#include <asm/amd_nb.h>
28 28
29static struct bootnode __initdata nodes[8];
30static unsigned char __initdata nodeids[8]; 29static unsigned char __initdata nodeids[8];
31 30
32static __init int find_northbridge(void) 31static __init int find_northbridge(void)
@@ -166,8 +165,8 @@ int __init amd_numa_init(void)
166 pr_info("Node %d MemBase %016lx Limit %016lx\n", 165 pr_info("Node %d MemBase %016lx Limit %016lx\n",
167 nodeid, base, limit); 166 nodeid, base, limit);
168 167
169 nodes[nodeid].start = base; 168 numa_nodes[nodeid].start = base;
170 nodes[nodeid].end = limit; 169 numa_nodes[nodeid].end = limit;
171 170
172 prevbase = base; 171 prevbase = base;
173 172
@@ -210,8 +209,8 @@ void __init amd_get_nodes(struct bootnode *physnodes)
210 int i; 209 int i;
211 210
212 for_each_node_mask(i, mem_nodes_parsed) { 211 for_each_node_mask(i, mem_nodes_parsed) {
213 physnodes[i].start = nodes[i].start; 212 physnodes[i].start = numa_nodes[i].start;
214 physnodes[i].end = nodes[i].end; 213 physnodes[i].end = numa_nodes[i].end;
215 } 214 }
216} 215}
217 216
@@ -221,7 +220,7 @@ static int __init find_node_by_addr(unsigned long addr)
221 int i; 220 int i;
222 221
223 for (i = 0; i < 8; i++) 222 for (i = 0; i < 8; i++)
224 if (addr >= nodes[i].start && addr < nodes[i].end) { 223 if (addr >= numa_nodes[i].start && addr < numa_nodes[i].end) {
225 ret = i; 224 ret = i;
226 break; 225 break;
227 } 226 }
@@ -274,7 +273,7 @@ int __init amd_scan_nodes(void)
274{ 273{
275 int i; 274 int i;
276 275
277 memnode_shift = compute_hash_shift(nodes, 8, NULL); 276 memnode_shift = compute_hash_shift(numa_nodes, 8, NULL);
278 if (memnode_shift < 0) { 277 if (memnode_shift < 0) {
279 pr_err("No NUMA node hash function found. Contact maintainer\n"); 278 pr_err("No NUMA node hash function found. Contact maintainer\n");
280 return -1; 279 return -1;
@@ -284,11 +283,11 @@ int __init amd_scan_nodes(void)
284 /* use the coreid bits from early_identify_cpu */ 283 /* use the coreid bits from early_identify_cpu */
285 for_each_node_mask(i, node_possible_map) 284 for_each_node_mask(i, node_possible_map)
286 memblock_x86_register_active_regions(i, 285 memblock_x86_register_active_regions(i,
287 nodes[i].start >> PAGE_SHIFT, 286 numa_nodes[i].start >> PAGE_SHIFT,
288 nodes[i].end >> PAGE_SHIFT); 287 numa_nodes[i].end >> PAGE_SHIFT);
289 init_memory_mapping_high(); 288 init_memory_mapping_high();
290 for_each_node_mask(i, node_possible_map) 289 for_each_node_mask(i, node_possible_map)
291 setup_node_bootmem(i, nodes[i].start, nodes[i].end); 290 setup_node_bootmem(i, numa_nodes[i].start, numa_nodes[i].end);
292 291
293 numa_init_array(); 292 numa_init_array();
294 return 0; 293 return 0;