diff options
Diffstat (limited to 'arch/x86/kernel/apic/numaq_32.c')
-rw-r--r-- | arch/x86/kernel/apic/numaq_32.c | 34 |
1 files changed, 10 insertions, 24 deletions
diff --git a/arch/x86/kernel/apic/numaq_32.c b/arch/x86/kernel/apic/numaq_32.c index 6273eee5134b..30f13319e24b 100644 --- a/arch/x86/kernel/apic/numaq_32.c +++ b/arch/x86/kernel/apic/numaq_32.c | |||
@@ -48,8 +48,6 @@ | |||
48 | #include <asm/e820.h> | 48 | #include <asm/e820.h> |
49 | #include <asm/ipi.h> | 49 | #include <asm/ipi.h> |
50 | 50 | ||
51 | #define MB_TO_PAGES(addr) ((addr) << (20 - PAGE_SHIFT)) | ||
52 | |||
53 | int found_numaq; | 51 | int found_numaq; |
54 | 52 | ||
55 | /* | 53 | /* |
@@ -79,31 +77,20 @@ int quad_local_to_mp_bus_id[NR_CPUS/4][4]; | |||
79 | static inline void numaq_register_node(int node, struct sys_cfg_data *scd) | 77 | static inline void numaq_register_node(int node, struct sys_cfg_data *scd) |
80 | { | 78 | { |
81 | struct eachquadmem *eq = scd->eq + node; | 79 | struct eachquadmem *eq = scd->eq + node; |
80 | u64 start = (u64)(eq->hi_shrd_mem_start - eq->priv_mem_size) << 20; | ||
81 | u64 end = (u64)(eq->hi_shrd_mem_start + eq->hi_shrd_mem_size) << 20; | ||
82 | int ret; | ||
82 | 83 | ||
83 | node_set_online(node); | 84 | node_set(node, numa_nodes_parsed); |
84 | 85 | ret = numa_add_memblk(node, start, end); | |
85 | /* Convert to pages */ | 86 | BUG_ON(ret < 0); |
86 | node_start_pfn[node] = | ||
87 | MB_TO_PAGES(eq->hi_shrd_mem_start - eq->priv_mem_size); | ||
88 | |||
89 | node_end_pfn[node] = | ||
90 | MB_TO_PAGES(eq->hi_shrd_mem_start + eq->hi_shrd_mem_size); | ||
91 | |||
92 | memblock_x86_register_active_regions(node, node_start_pfn[node], | ||
93 | node_end_pfn[node]); | ||
94 | |||
95 | memory_present(node, node_start_pfn[node], node_end_pfn[node]); | ||
96 | |||
97 | node_remap_size[node] = node_memmap_size_bytes(node, | ||
98 | node_start_pfn[node], | ||
99 | node_end_pfn[node]); | ||
100 | } | 87 | } |
101 | 88 | ||
102 | /* | 89 | /* |
103 | * Function: smp_dump_qct() | 90 | * Function: smp_dump_qct() |
104 | * | 91 | * |
105 | * Description: gets memory layout from the quad config table. This | 92 | * Description: gets memory layout from the quad config table. This |
106 | * function also updates node_online_map with the nodes (quads) present. | 93 | * function also updates numa_nodes_parsed with the nodes (quads) present. |
107 | */ | 94 | */ |
108 | static void __init smp_dump_qct(void) | 95 | static void __init smp_dump_qct(void) |
109 | { | 96 | { |
@@ -112,7 +99,6 @@ static void __init smp_dump_qct(void) | |||
112 | 99 | ||
113 | scd = (void *)__va(SYS_CFG_DATA_PRIV_ADDR); | 100 | scd = (void *)__va(SYS_CFG_DATA_PRIV_ADDR); |
114 | 101 | ||
115 | nodes_clear(node_online_map); | ||
116 | for_each_node(node) { | 102 | for_each_node(node) { |
117 | if (scd->quads_present31_0 & (1 << node)) | 103 | if (scd->quads_present31_0 & (1 << node)) |
118 | numaq_register_node(node, scd); | 104 | numaq_register_node(node, scd); |
@@ -282,14 +268,14 @@ static __init void early_check_numaq(void) | |||
282 | } | 268 | } |
283 | } | 269 | } |
284 | 270 | ||
285 | int __init get_memcfg_numaq(void) | 271 | int __init numaq_numa_init(void) |
286 | { | 272 | { |
287 | early_check_numaq(); | 273 | early_check_numaq(); |
288 | if (!found_numaq) | 274 | if (!found_numaq) |
289 | return 0; | 275 | return -ENOENT; |
290 | smp_dump_qct(); | 276 | smp_dump_qct(); |
291 | 277 | ||
292 | return 1; | 278 | return 0; |
293 | } | 279 | } |
294 | 280 | ||
295 | #define NUMAQ_APIC_DFR_VALUE (APIC_DFR_CLUSTER) | 281 | #define NUMAQ_APIC_DFR_VALUE (APIC_DFR_CLUSTER) |