diff options
Diffstat (limited to 'arch/x86_64/mm/init.c')
-rw-r--r-- | arch/x86_64/mm/init.c | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/arch/x86_64/mm/init.c b/arch/x86_64/mm/init.c index 971dc1181e69..2968b90ef8ad 100644 --- a/arch/x86_64/mm/init.c +++ b/arch/x86_64/mm/init.c | |||
@@ -496,7 +496,7 @@ int remove_memory(u64 start, u64 size) | |||
496 | } | 496 | } |
497 | EXPORT_SYMBOL_GPL(remove_memory); | 497 | EXPORT_SYMBOL_GPL(remove_memory); |
498 | 498 | ||
499 | #ifndef CONFIG_ACPI_NUMA | 499 | #if !defined(CONFIG_ACPI_NUMA) && defined(CONFIG_NUMA) |
500 | int memory_add_physaddr_to_nid(u64 start) | 500 | int memory_add_physaddr_to_nid(u64 start) |
501 | { | 501 | { |
502 | return 0; | 502 | return 0; |
@@ -504,13 +504,6 @@ int memory_add_physaddr_to_nid(u64 start) | |||
504 | EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid); | 504 | EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid); |
505 | #endif | 505 | #endif |
506 | 506 | ||
507 | #ifndef CONFIG_ACPI_NUMA | ||
508 | int memory_add_physaddr_to_nid(u64 start) | ||
509 | { | ||
510 | return 0; | ||
511 | } | ||
512 | #endif | ||
513 | |||
514 | #endif /* CONFIG_MEMORY_HOTPLUG */ | 507 | #endif /* CONFIG_MEMORY_HOTPLUG */ |
515 | 508 | ||
516 | #ifdef CONFIG_MEMORY_HOTPLUG_RESERVE | 509 | #ifdef CONFIG_MEMORY_HOTPLUG_RESERVE |
@@ -655,9 +648,22 @@ void free_initrd_mem(unsigned long start, unsigned long end) | |||
655 | 648 | ||
656 | void __init reserve_bootmem_generic(unsigned long phys, unsigned len) | 649 | void __init reserve_bootmem_generic(unsigned long phys, unsigned len) |
657 | { | 650 | { |
658 | /* Should check here against the e820 map to avoid double free */ | ||
659 | #ifdef CONFIG_NUMA | 651 | #ifdef CONFIG_NUMA |
660 | int nid = phys_to_nid(phys); | 652 | int nid = phys_to_nid(phys); |
653 | #endif | ||
654 | unsigned long pfn = phys >> PAGE_SHIFT; | ||
655 | if (pfn >= end_pfn) { | ||
656 | /* This can happen with kdump kernels when accessing firmware | ||
657 | tables. */ | ||
658 | if (pfn < end_pfn_map) | ||
659 | return; | ||
660 | printk(KERN_ERR "reserve_bootmem: illegal reserve %lx %u\n", | ||
661 | phys, len); | ||
662 | return; | ||
663 | } | ||
664 | |||
665 | /* Should check here against the e820 map to avoid double free */ | ||
666 | #ifdef CONFIG_NUMA | ||
661 | reserve_bootmem_node(NODE_DATA(nid), phys, len); | 667 | reserve_bootmem_node(NODE_DATA(nid), phys, len); |
662 | #else | 668 | #else |
663 | reserve_bootmem(phys, len); | 669 | reserve_bootmem(phys, len); |
@@ -724,14 +730,15 @@ static __init int x8664_sysctl_init(void) | |||
724 | __initcall(x8664_sysctl_init); | 730 | __initcall(x8664_sysctl_init); |
725 | #endif | 731 | #endif |
726 | 732 | ||
727 | /* A pseudo VMAs to allow ptrace access for the vsyscall page. This only | 733 | /* A pseudo VMA to allow ptrace access for the vsyscall page. This only |
728 | covers the 64bit vsyscall page now. 32bit has a real VMA now and does | 734 | covers the 64bit vsyscall page now. 32bit has a real VMA now and does |
729 | not need special handling anymore. */ | 735 | not need special handling anymore. */ |
730 | 736 | ||
731 | static struct vm_area_struct gate_vma = { | 737 | static struct vm_area_struct gate_vma = { |
732 | .vm_start = VSYSCALL_START, | 738 | .vm_start = VSYSCALL_START, |
733 | .vm_end = VSYSCALL_END, | 739 | .vm_end = VSYSCALL_START + (VSYSCALL_MAPPED_PAGES << PAGE_SHIFT), |
734 | .vm_page_prot = PAGE_READONLY | 740 | .vm_page_prot = PAGE_READONLY_EXEC, |
741 | .vm_flags = VM_READ | VM_EXEC | ||
735 | }; | 742 | }; |
736 | 743 | ||
737 | struct vm_area_struct *get_gate_vma(struct task_struct *tsk) | 744 | struct vm_area_struct *get_gate_vma(struct task_struct *tsk) |