diff options
-rw-r--r-- | arch/x86/include/asm/numa_64.h | 1 | ||||
-rw-r--r-- | arch/x86/mm/amdtopology_64.c | 13 | ||||
-rw-r--r-- | arch/x86/mm/numa_64.c | 19 | ||||
-rw-r--r-- | arch/x86/mm/srat_64.c | 18 |
4 files changed, 20 insertions, 31 deletions
diff --git a/arch/x86/include/asm/numa_64.h b/arch/x86/include/asm/numa_64.h index e925605150a0..925ade9d67e4 100644 --- a/arch/x86/include/asm/numa_64.h +++ b/arch/x86/include/asm/numa_64.h | |||
@@ -35,6 +35,7 @@ extern int __init numa_add_memblk(int nodeid, u64 start, u64 end); | |||
35 | #define FAKE_NODE_MIN_SIZE ((u64)32 << 20) | 35 | #define FAKE_NODE_MIN_SIZE ((u64)32 << 20) |
36 | #define FAKE_NODE_MIN_HASH_MASK (~(FAKE_NODE_MIN_SIZE - 1UL)) | 36 | #define FAKE_NODE_MIN_HASH_MASK (~(FAKE_NODE_MIN_SIZE - 1UL)) |
37 | void numa_emu_cmdline(char *); | 37 | void numa_emu_cmdline(char *); |
38 | int __init find_node_by_addr(unsigned long addr); | ||
38 | #endif /* CONFIG_NUMA_EMU */ | 39 | #endif /* CONFIG_NUMA_EMU */ |
39 | #else | 40 | #else |
40 | static inline int numa_cpu_node(int cpu) { return NUMA_NO_NODE; } | 41 | static inline int numa_cpu_node(int cpu) { return NUMA_NO_NODE; } |
diff --git a/arch/x86/mm/amdtopology_64.c b/arch/x86/mm/amdtopology_64.c index 90cf297b3b59..8f7a5eb4bd3c 100644 --- a/arch/x86/mm/amdtopology_64.c +++ b/arch/x86/mm/amdtopology_64.c | |||
@@ -205,19 +205,6 @@ static s16 fake_apicid_to_node[MAX_LOCAL_APIC] __initdata = { | |||
205 | [0 ... MAX_LOCAL_APIC-1] = NUMA_NO_NODE | 205 | [0 ... MAX_LOCAL_APIC-1] = NUMA_NO_NODE |
206 | }; | 206 | }; |
207 | 207 | ||
208 | static int __init find_node_by_addr(unsigned long addr) | ||
209 | { | ||
210 | int ret = NUMA_NO_NODE; | ||
211 | int i; | ||
212 | |||
213 | for (i = 0; i < 8; i++) | ||
214 | if (addr >= numa_nodes[i].start && addr < numa_nodes[i].end) { | ||
215 | ret = i; | ||
216 | break; | ||
217 | } | ||
218 | return ret; | ||
219 | } | ||
220 | |||
221 | /* | 208 | /* |
222 | * For NUMA emulation, fake proximity domain (_PXM) to node id mappings must be | 209 | * For NUMA emulation, fake proximity domain (_PXM) to node id mappings must be |
223 | * setup to represent the physical topology but reflect the emulated | 210 | * setup to represent the physical topology but reflect the emulated |
diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c index 20aa1d31e165..681bc0d59db5 100644 --- a/arch/x86/mm/numa_64.c +++ b/arch/x86/mm/numa_64.c | |||
@@ -430,6 +430,25 @@ void __init numa_emu_cmdline(char *str) | |||
430 | cmdline = str; | 430 | cmdline = str; |
431 | } | 431 | } |
432 | 432 | ||
433 | int __init find_node_by_addr(unsigned long addr) | ||
434 | { | ||
435 | int ret = NUMA_NO_NODE; | ||
436 | int i; | ||
437 | |||
438 | for_each_node_mask(i, mem_nodes_parsed) { | ||
439 | /* | ||
440 | * Find the real node that this emulated node appears on. For | ||
441 | * the sake of simplicity, we only use a real node's starting | ||
442 | * address to determine which emulated node it appears on. | ||
443 | */ | ||
444 | if (addr >= numa_nodes[i].start && addr < numa_nodes[i].end) { | ||
445 | ret = i; | ||
446 | break; | ||
447 | } | ||
448 | } | ||
449 | return ret; | ||
450 | } | ||
451 | |||
433 | static int __init setup_physnodes(unsigned long start, unsigned long end) | 452 | static int __init setup_physnodes(unsigned long start, unsigned long end) |
434 | { | 453 | { |
435 | int ret = 0; | 454 | int ret = 0; |
diff --git a/arch/x86/mm/srat_64.c b/arch/x86/mm/srat_64.c index d56eff811cd8..51d07338d2e4 100644 --- a/arch/x86/mm/srat_64.c +++ b/arch/x86/mm/srat_64.c | |||
@@ -277,24 +277,6 @@ static int fake_node_to_pxm_map[MAX_NUMNODES] __initdata = { | |||
277 | static s16 fake_apicid_to_node[MAX_LOCAL_APIC] __initdata = { | 277 | static s16 fake_apicid_to_node[MAX_LOCAL_APIC] __initdata = { |
278 | [0 ... MAX_LOCAL_APIC-1] = NUMA_NO_NODE | 278 | [0 ... MAX_LOCAL_APIC-1] = NUMA_NO_NODE |
279 | }; | 279 | }; |
280 | static int __init find_node_by_addr(unsigned long addr) | ||
281 | { | ||
282 | int ret = NUMA_NO_NODE; | ||
283 | int i; | ||
284 | |||
285 | for_each_node_mask(i, mem_nodes_parsed) { | ||
286 | /* | ||
287 | * Find the real node that this emulated node appears on. For | ||
288 | * the sake of simplicity, we only use a real node's starting | ||
289 | * address to determine which emulated node it appears on. | ||
290 | */ | ||
291 | if (addr >= numa_nodes[i].start && addr < numa_nodes[i].end) { | ||
292 | ret = i; | ||
293 | break; | ||
294 | } | ||
295 | } | ||
296 | return ret; | ||
297 | } | ||
298 | 280 | ||
299 | /* | 281 | /* |
300 | * In NUMA emulation, we need to setup proximity domain (_PXM) to node ID | 282 | * In NUMA emulation, we need to setup proximity domain (_PXM) to node ID |