aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-02-21 21:06:55 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-21 21:06:55 -0500
commit2ef14f465b9e096531343f5b734cffc5f759f4a6 (patch)
tree07b504d7105842a4b1a74cf1e153023a02fb9c1e /mm
parentcb715a836642e0ec69350670d1c2f800f3e2d2e4 (diff)
parent0da3e7f526fde7a6522a3038b7ce609fc50f6707 (diff)
Merge branch 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 mm changes from Peter Anvin: "This is a huge set of several partly interrelated (and concurrently developed) changes, which is why the branch history is messier than one would like. The *really* big items are two humonguous patchsets mostly developed by Yinghai Lu at my request, which completely revamps the way we create initial page tables. In particular, rather than estimating how much memory we will need for page tables and then build them into that memory -- a calculation that has shown to be incredibly fragile -- we now build them (on 64 bits) with the aid of a "pseudo-linear mode" -- a #PF handler which creates temporary page tables on demand. This has several advantages: 1. It makes it much easier to support things that need access to data very early (a followon patchset uses this to load microcode way early in the kernel startup). 2. It allows the kernel and all the kernel data objects to be invoked from above the 4 GB limit. This allows kdump to work on very large systems. 3. It greatly reduces the difference between Xen and native (Xen's equivalent of the #PF handler are the temporary page tables created by the domain builder), eliminating a bunch of fragile hooks. The patch series also gets us a bit closer to W^X. Additional work in this pull is the 64-bit get_user() work which you were also involved with, and a bunch of cleanups/speedups to __phys_addr()/__pa()." * 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (105 commits) x86, mm: Move reserving low memory later in initialization x86, doc: Clarify the use of asm("%edx") in uaccess.h x86, mm: Redesign get_user with a __builtin_choose_expr hack x86: Be consistent with data size in getuser.S x86, mm: Use a bitfield to mask nuisance get_user() warnings x86/kvm: Fix compile warning in kvm_register_steal_time() x86-32: Add support for 64bit get_user() x86-32, mm: Remove reference to alloc_remap() x86-32, mm: Remove reference to resume_map_numa_kva() x86-32, mm: Rip out x86_32 NUMA remapping code x86/numa: Use __pa_nodebug() instead x86: Don't panic if can not alloc buffer for swiotlb mm: Add alloc_bootmem_low_pages_nopanic() x86, 64bit, mm: hibernate use generic mapping_init x86, 64bit, mm: Mark data/bss/brk to nx x86: Merge early kernel reserve for 32bit and 64bit x86: Add Crash kernel low reservation x86, kdump: Remove crashkernel range find limit for 64bit memblock: Add memblock_mem_size() x86, boot: Not need to check setup_header version for setup_data ...
Diffstat (limited to 'mm')
-rw-r--r--mm/bootmem.c8
-rw-r--r--mm/memblock.c17
-rw-r--r--mm/nobootmem.c23
3 files changed, 33 insertions, 15 deletions
diff --git a/mm/bootmem.c b/mm/bootmem.c
index b93376c39b61..2b0bcb019ec2 100644
--- a/mm/bootmem.c
+++ b/mm/bootmem.c
@@ -833,6 +833,14 @@ void * __init __alloc_bootmem_low(unsigned long size, unsigned long align,
833 return ___alloc_bootmem(size, align, goal, ARCH_LOW_ADDRESS_LIMIT); 833 return ___alloc_bootmem(size, align, goal, ARCH_LOW_ADDRESS_LIMIT);
834} 834}
835 835
836void * __init __alloc_bootmem_low_nopanic(unsigned long size,
837 unsigned long align,
838 unsigned long goal)
839{
840 return ___alloc_bootmem_nopanic(size, align, goal,
841 ARCH_LOW_ADDRESS_LIMIT);
842}
843
836/** 844/**
837 * __alloc_bootmem_low_node - allocate low boot memory from a specific node 845 * __alloc_bootmem_low_node - allocate low boot memory from a specific node
838 * @pgdat: node to allocate from 846 * @pgdat: node to allocate from
diff --git a/mm/memblock.c b/mm/memblock.c
index 88adc8afb610..b8d9147e5c08 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -828,6 +828,23 @@ phys_addr_t __init memblock_phys_mem_size(void)
828 return memblock.memory.total_size; 828 return memblock.memory.total_size;
829} 829}
830 830
831phys_addr_t __init memblock_mem_size(unsigned long limit_pfn)
832{
833 unsigned long pages = 0;
834 struct memblock_region *r;
835 unsigned long start_pfn, end_pfn;
836
837 for_each_memblock(memory, r) {
838 start_pfn = memblock_region_memory_base_pfn(r);
839 end_pfn = memblock_region_memory_end_pfn(r);
840 start_pfn = min_t(unsigned long, start_pfn, limit_pfn);
841 end_pfn = min_t(unsigned long, end_pfn, limit_pfn);
842 pages += end_pfn - start_pfn;
843 }
844
845 return (phys_addr_t)pages << PAGE_SHIFT;
846}
847
831/* lowest address */ 848/* lowest address */
832phys_addr_t __init_memblock memblock_start_of_DRAM(void) 849phys_addr_t __init_memblock memblock_start_of_DRAM(void)
833{ 850{
diff --git a/mm/nobootmem.c b/mm/nobootmem.c
index b8294fc03df8..5e07d36e381e 100644
--- a/mm/nobootmem.c
+++ b/mm/nobootmem.c
@@ -154,21 +154,6 @@ static void reset_node_lowmem_managed_pages(pg_data_t *pgdat)
154} 154}
155 155
156/** 156/**
157 * free_all_bootmem_node - release a node's free pages to the buddy allocator
158 * @pgdat: node to be released
159 *
160 * Returns the number of pages actually released.
161 */
162unsigned long __init free_all_bootmem_node(pg_data_t *pgdat)
163{
164 register_page_bootmem_info_node(pgdat);
165 reset_node_lowmem_managed_pages(pgdat);
166
167 /* free_low_memory_core_early(MAX_NUMNODES) will be called later */
168 return 0;
169}
170
171/**
172 * free_all_bootmem - release free pages to the buddy allocator 157 * free_all_bootmem - release free pages to the buddy allocator
173 * 158 *
174 * Returns the number of pages actually released. 159 * Returns the number of pages actually released.
@@ -406,6 +391,14 @@ void * __init __alloc_bootmem_low(unsigned long size, unsigned long align,
406 return ___alloc_bootmem(size, align, goal, ARCH_LOW_ADDRESS_LIMIT); 391 return ___alloc_bootmem(size, align, goal, ARCH_LOW_ADDRESS_LIMIT);
407} 392}
408 393
394void * __init __alloc_bootmem_low_nopanic(unsigned long size,
395 unsigned long align,
396 unsigned long goal)
397{
398 return ___alloc_bootmem_nopanic(size, align, goal,
399 ARCH_LOW_ADDRESS_LIMIT);
400}
401
409/** 402/**
410 * __alloc_bootmem_low_node - allocate low boot memory from a specific node 403 * __alloc_bootmem_low_node - allocate low boot memory from a specific node
411 * @pgdat: node to allocate from 404 * @pgdat: node to allocate from