diff options
Diffstat (limited to 'arch/x86/mm')
-rw-r--r-- | arch/x86/mm/init.c | 18 | ||||
-rw-r--r-- | arch/x86/mm/kmmio.c | 2 | ||||
-rw-r--r-- | arch/x86/mm/numa_32.c | 2 | ||||
-rw-r--r-- | arch/x86/mm/numa_64.c | 3 | ||||
-rw-r--r-- | arch/x86/mm/srat_32.c | 2 | ||||
-rw-r--r-- | arch/x86/mm/srat_64.c | 7 |
6 files changed, 29 insertions, 5 deletions
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c index fd3da1dda1c9..ae4f7b5d7104 100644 --- a/arch/x86/mm/init.c +++ b/arch/x86/mm/init.c | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <asm/page.h> | 7 | #include <asm/page.h> |
8 | #include <asm/page_types.h> | 8 | #include <asm/page_types.h> |
9 | #include <asm/sections.h> | 9 | #include <asm/sections.h> |
10 | #include <asm/setup.h> | ||
10 | #include <asm/system.h> | 11 | #include <asm/system.h> |
11 | #include <asm/tlbflush.h> | 12 | #include <asm/tlbflush.h> |
12 | 13 | ||
@@ -304,8 +305,23 @@ unsigned long __init_refok init_memory_mapping(unsigned long start, | |||
304 | #endif | 305 | #endif |
305 | 306 | ||
306 | #ifdef CONFIG_X86_64 | 307 | #ifdef CONFIG_X86_64 |
307 | if (!after_bootmem) | 308 | if (!after_bootmem && !start) { |
309 | pud_t *pud; | ||
310 | pmd_t *pmd; | ||
311 | |||
308 | mmu_cr4_features = read_cr4(); | 312 | mmu_cr4_features = read_cr4(); |
313 | |||
314 | /* | ||
315 | * _brk_end cannot change anymore, but it and _end may be | ||
316 | * located on different 2M pages. cleanup_highmap(), however, | ||
317 | * can only consider _end when it runs, so destroy any | ||
318 | * mappings beyond _brk_end here. | ||
319 | */ | ||
320 | pud = pud_offset(pgd_offset_k(_brk_end), _brk_end); | ||
321 | pmd = pmd_offset(pud, _brk_end - 1); | ||
322 | while (++pmd <= pmd_offset(pud, (unsigned long)_end - 1)) | ||
323 | pmd_clear(pmd); | ||
324 | } | ||
309 | #endif | 325 | #endif |
310 | __flush_tlb_all(); | 326 | __flush_tlb_all(); |
311 | 327 | ||
diff --git a/arch/x86/mm/kmmio.c b/arch/x86/mm/kmmio.c index 4f115e00486b..50dc802a1c46 100644 --- a/arch/x86/mm/kmmio.c +++ b/arch/x86/mm/kmmio.c | |||
@@ -87,7 +87,7 @@ static struct kmmio_probe *get_kmmio_probe(unsigned long addr) | |||
87 | { | 87 | { |
88 | struct kmmio_probe *p; | 88 | struct kmmio_probe *p; |
89 | list_for_each_entry_rcu(p, &kmmio_probes, list) { | 89 | list_for_each_entry_rcu(p, &kmmio_probes, list) { |
90 | if (addr >= p->addr && addr <= (p->addr + p->len)) | 90 | if (addr >= p->addr && addr < (p->addr + p->len)) |
91 | return p; | 91 | return p; |
92 | } | 92 | } |
93 | return NULL; | 93 | return NULL; |
diff --git a/arch/x86/mm/numa_32.c b/arch/x86/mm/numa_32.c index 3daefa04ace5..d2530062fe00 100644 --- a/arch/x86/mm/numa_32.c +++ b/arch/x86/mm/numa_32.c | |||
@@ -257,7 +257,7 @@ void resume_map_numa_kva(pgd_t *pgd_base) | |||
257 | } | 257 | } |
258 | #endif | 258 | #endif |
259 | 259 | ||
260 | static unsigned long calculate_numa_remap_pages(void) | 260 | static __init unsigned long calculate_numa_remap_pages(void) |
261 | { | 261 | { |
262 | int nid; | 262 | int nid; |
263 | unsigned long size, reserve_pages = 0; | 263 | unsigned long size, reserve_pages = 0; |
diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c index d73aaa892371..2d05a12029dc 100644 --- a/arch/x86/mm/numa_64.c +++ b/arch/x86/mm/numa_64.c | |||
@@ -188,6 +188,9 @@ void __init setup_node_bootmem(int nodeid, unsigned long start, | |||
188 | const int pgdat_size = roundup(sizeof(pg_data_t), PAGE_SIZE); | 188 | const int pgdat_size = roundup(sizeof(pg_data_t), PAGE_SIZE); |
189 | int nid; | 189 | int nid; |
190 | 190 | ||
191 | if (!end) | ||
192 | return; | ||
193 | |||
191 | start = roundup(start, ZONE_ALIGN); | 194 | start = roundup(start, ZONE_ALIGN); |
192 | 195 | ||
193 | printk(KERN_INFO "Bootmem setup node %d %016lx-%016lx\n", nodeid, | 196 | printk(KERN_INFO "Bootmem setup node %d %016lx-%016lx\n", nodeid, |
diff --git a/arch/x86/mm/srat_32.c b/arch/x86/mm/srat_32.c index 16ae70fc57e7..29a0e37114f8 100644 --- a/arch/x86/mm/srat_32.c +++ b/arch/x86/mm/srat_32.c | |||
@@ -216,7 +216,7 @@ int __init get_memcfg_from_srat(void) | |||
216 | 216 | ||
217 | if (num_memory_chunks == 0) { | 217 | if (num_memory_chunks == 0) { |
218 | printk(KERN_WARNING | 218 | printk(KERN_WARNING |
219 | "could not finy any ACPI SRAT memory areas.\n"); | 219 | "could not find any ACPI SRAT memory areas.\n"); |
220 | goto out_fail; | 220 | goto out_fail; |
221 | } | 221 | } |
222 | 222 | ||
diff --git a/arch/x86/mm/srat_64.c b/arch/x86/mm/srat_64.c index c7d272b8574c..01765955baaf 100644 --- a/arch/x86/mm/srat_64.c +++ b/arch/x86/mm/srat_64.c | |||
@@ -28,6 +28,7 @@ int acpi_numa __initdata; | |||
28 | static struct acpi_table_slit *acpi_slit; | 28 | static struct acpi_table_slit *acpi_slit; |
29 | 29 | ||
30 | static nodemask_t nodes_parsed __initdata; | 30 | static nodemask_t nodes_parsed __initdata; |
31 | static nodemask_t cpu_nodes_parsed __initdata; | ||
31 | static struct bootnode nodes[MAX_NUMNODES] __initdata; | 32 | static struct bootnode nodes[MAX_NUMNODES] __initdata; |
32 | static struct bootnode nodes_add[MAX_NUMNODES]; | 33 | static struct bootnode nodes_add[MAX_NUMNODES]; |
33 | static int found_add_area __initdata; | 34 | static int found_add_area __initdata; |
@@ -141,6 +142,7 @@ acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa) | |||
141 | 142 | ||
142 | apic_id = pa->apic_id; | 143 | apic_id = pa->apic_id; |
143 | apicid_to_node[apic_id] = node; | 144 | apicid_to_node[apic_id] = node; |
145 | node_set(node, cpu_nodes_parsed); | ||
144 | acpi_numa = 1; | 146 | acpi_numa = 1; |
145 | printk(KERN_INFO "SRAT: PXM %u -> APIC %u -> Node %u\n", | 147 | printk(KERN_INFO "SRAT: PXM %u -> APIC %u -> Node %u\n", |
146 | pxm, apic_id, node); | 148 | pxm, apic_id, node); |
@@ -174,6 +176,7 @@ acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa) | |||
174 | else | 176 | else |
175 | apic_id = pa->apic_id; | 177 | apic_id = pa->apic_id; |
176 | apicid_to_node[apic_id] = node; | 178 | apicid_to_node[apic_id] = node; |
179 | node_set(node, cpu_nodes_parsed); | ||
177 | acpi_numa = 1; | 180 | acpi_numa = 1; |
178 | printk(KERN_INFO "SRAT: PXM %u -> APIC %u -> Node %u\n", | 181 | printk(KERN_INFO "SRAT: PXM %u -> APIC %u -> Node %u\n", |
179 | pxm, apic_id, node); | 182 | pxm, apic_id, node); |
@@ -358,6 +361,7 @@ static void __init unparse_node(int node) | |||
358 | { | 361 | { |
359 | int i; | 362 | int i; |
360 | node_clear(node, nodes_parsed); | 363 | node_clear(node, nodes_parsed); |
364 | node_clear(node, cpu_nodes_parsed); | ||
361 | for (i = 0; i < MAX_LOCAL_APIC; i++) { | 365 | for (i = 0; i < MAX_LOCAL_APIC; i++) { |
362 | if (apicid_to_node[i] == node) | 366 | if (apicid_to_node[i] == node) |
363 | apicid_to_node[i] = NUMA_NO_NODE; | 367 | apicid_to_node[i] = NUMA_NO_NODE; |
@@ -402,7 +406,8 @@ int __init acpi_scan_nodes(unsigned long start, unsigned long end) | |||
402 | return -1; | 406 | return -1; |
403 | } | 407 | } |
404 | 408 | ||
405 | node_possible_map = nodes_parsed; | 409 | /* Account for nodes with cpus and no memory */ |
410 | nodes_or(node_possible_map, nodes_parsed, cpu_nodes_parsed); | ||
406 | 411 | ||
407 | /* Finally register nodes */ | 412 | /* Finally register nodes */ |
408 | for_each_node_mask(i, node_possible_map) | 413 | for_each_node_mask(i, node_possible_map) |