diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-21 21:52:11 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-21 21:52:11 -0400 |
commit | 3044100e58c84e133791c8b60a2f5bef69d732e4 (patch) | |
tree | f9ed0d1f3df89c31dd81ccaf0cf3478f57b08440 /arch/x86/mm/init_64.c | |
parent | b5153163ed580e00c67bdfecb02b2e3843817b3e (diff) | |
parent | 67e87f0a1c5cbc750f81ebf6a128e8ff6f4376cc (diff) |
Merge branch 'core-memblock-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'core-memblock-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (74 commits)
x86-64: Only set max_pfn_mapped to 512 MiB if we enter via head_64.S
xen: Cope with unmapped pages when initializing kernel pagetable
memblock, bootmem: Round pfn properly for memory and reserved regions
memblock: Annotate memblock functions with __init_memblock
memblock: Allow memblock_init to be called early
memblock/arm: Fix memblock_region_is_memory() typo
x86, memblock: Remove __memblock_x86_find_in_range_size()
memblock: Fix wraparound in find_region()
x86-32, memblock: Make add_highpages honor early reserved ranges
x86, memblock: Fix crashkernel allocation
arm, memblock: Fix the sparsemem build
memblock: Fix section mismatch warnings
powerpc, memblock: Fix memblock API change fallout
memblock, microblaze: Fix memblock API change fallout
x86: Remove old bootmem code
x86, memblock: Use memblock_memory_size()/memblock_free_memory_size() to get correct dma_reserve
x86: Remove not used early_res code
x86, memblock: Replace e820_/_early string with memblock_
x86: Use memblock to replace early_res
x86, memblock: Use memblock_debug to control debug message print out
...
Fix up trivial conflicts in arch/x86/kernel/setup.c and kernel/Makefile
Diffstat (limited to 'arch/x86/mm/init_64.c')
-rw-r--r-- | arch/x86/mm/init_64.c | 67 |
1 files changed, 2 insertions, 65 deletions
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index c55f900fbf89..84346200e783 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/initrd.h> | 21 | #include <linux/initrd.h> |
22 | #include <linux/pagemap.h> | 22 | #include <linux/pagemap.h> |
23 | #include <linux/bootmem.h> | 23 | #include <linux/bootmem.h> |
24 | #include <linux/memblock.h> | ||
24 | #include <linux/proc_fs.h> | 25 | #include <linux/proc_fs.h> |
25 | #include <linux/pci.h> | 26 | #include <linux/pci.h> |
26 | #include <linux/pfn.h> | 27 | #include <linux/pfn.h> |
@@ -52,8 +53,6 @@ | |||
52 | #include <asm/init.h> | 53 | #include <asm/init.h> |
53 | #include <linux/bootmem.h> | 54 | #include <linux/bootmem.h> |
54 | 55 | ||
55 | static unsigned long dma_reserve __initdata; | ||
56 | |||
57 | static int __init parse_direct_gbpages_off(char *arg) | 56 | static int __init parse_direct_gbpages_off(char *arg) |
58 | { | 57 | { |
59 | direct_gbpages = 0; | 58 | direct_gbpages = 0; |
@@ -617,23 +616,7 @@ kernel_physical_mapping_init(unsigned long start, | |||
617 | void __init initmem_init(unsigned long start_pfn, unsigned long end_pfn, | 616 | void __init initmem_init(unsigned long start_pfn, unsigned long end_pfn, |
618 | int acpi, int k8) | 617 | int acpi, int k8) |
619 | { | 618 | { |
620 | #ifndef CONFIG_NO_BOOTMEM | 619 | memblock_x86_register_active_regions(0, start_pfn, end_pfn); |
621 | unsigned long bootmap_size, bootmap; | ||
622 | |||
623 | bootmap_size = bootmem_bootmap_pages(end_pfn)<<PAGE_SHIFT; | ||
624 | bootmap = find_e820_area(0, end_pfn<<PAGE_SHIFT, bootmap_size, | ||
625 | PAGE_SIZE); | ||
626 | if (bootmap == -1L) | ||
627 | panic("Cannot find bootmem map of size %ld\n", bootmap_size); | ||
628 | reserve_early(bootmap, bootmap + bootmap_size, "BOOTMAP"); | ||
629 | /* don't touch min_low_pfn */ | ||
630 | bootmap_size = init_bootmem_node(NODE_DATA(0), bootmap >> PAGE_SHIFT, | ||
631 | 0, end_pfn); | ||
632 | e820_register_active_regions(0, start_pfn, end_pfn); | ||
633 | free_bootmem_with_active_regions(0, end_pfn); | ||
634 | #else | ||
635 | e820_register_active_regions(0, start_pfn, end_pfn); | ||
636 | #endif | ||
637 | } | 620 | } |
638 | #endif | 621 | #endif |
639 | 622 | ||
@@ -843,52 +826,6 @@ void mark_rodata_ro(void) | |||
843 | 826 | ||
844 | #endif | 827 | #endif |
845 | 828 | ||
846 | int __init reserve_bootmem_generic(unsigned long phys, unsigned long len, | ||
847 | int flags) | ||
848 | { | ||
849 | #ifdef CONFIG_NUMA | ||
850 | int nid, next_nid; | ||
851 | int ret; | ||
852 | #endif | ||
853 | unsigned long pfn = phys >> PAGE_SHIFT; | ||
854 | |||
855 | if (pfn >= max_pfn) { | ||
856 | /* | ||
857 | * This can happen with kdump kernels when accessing | ||
858 | * firmware tables: | ||
859 | */ | ||
860 | if (pfn < max_pfn_mapped) | ||
861 | return -EFAULT; | ||
862 | |||
863 | printk(KERN_ERR "reserve_bootmem: illegal reserve %lx %lu\n", | ||
864 | phys, len); | ||
865 | return -EFAULT; | ||
866 | } | ||
867 | |||
868 | /* Should check here against the e820 map to avoid double free */ | ||
869 | #ifdef CONFIG_NUMA | ||
870 | nid = phys_to_nid(phys); | ||
871 | next_nid = phys_to_nid(phys + len - 1); | ||
872 | if (nid == next_nid) | ||
873 | ret = reserve_bootmem_node(NODE_DATA(nid), phys, len, flags); | ||
874 | else | ||
875 | ret = reserve_bootmem(phys, len, flags); | ||
876 | |||
877 | if (ret != 0) | ||
878 | return ret; | ||
879 | |||
880 | #else | ||
881 | reserve_bootmem(phys, len, flags); | ||
882 | #endif | ||
883 | |||
884 | if (phys+len <= MAX_DMA_PFN*PAGE_SIZE) { | ||
885 | dma_reserve += len / PAGE_SIZE; | ||
886 | set_dma_reserve(dma_reserve); | ||
887 | } | ||
888 | |||
889 | return 0; | ||
890 | } | ||
891 | |||
892 | int kern_addr_valid(unsigned long addr) | 829 | int kern_addr_valid(unsigned long addr) |
893 | { | 830 | { |
894 | unsigned long above = ((long)addr) >> __VIRTUAL_MASK_SHIFT; | 831 | unsigned long above = ((long)addr) >> __VIRTUAL_MASK_SHIFT; |