diff options
author | Yinghai Lu <yinghai@kernel.org> | 2012-11-16 22:38:41 -0500 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2012-11-17 14:59:03 -0500 |
commit | 22ddfcaa0dbae992332381d41b8a1fbc72269a13 (patch) | |
tree | 01791d16254b54f6aad4b5381675b4269bda4d45 /arch/x86/mm/init.c | |
parent | 2086fe1159a9a75233b533986ccfcbd192bd9372 (diff) |
x86, mm: Move init_memory_mapping calling out of setup.c
Now init_memory_mapping is called two times, later will be called for every
ram ranges.
Could put all related init_mem calling together and out of setup.c.
Actually, it reverts commit 1bbbbe7
x86: Exclude E820_RESERVED regions and memory holes above 4 GB from direct mapping.
will address that later with complete solution include handling hole under 4g.
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Link: http://lkml.kernel.org/r/1353123563-3103-5-git-send-email-yinghai@kernel.org
Reviewed-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/x86/mm/init.c')
-rw-r--r-- | arch/x86/mm/init.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c index 701abbc24735..9e17f9e18a21 100644 --- a/arch/x86/mm/init.c +++ b/arch/x86/mm/init.c | |||
@@ -37,7 +37,7 @@ struct map_range { | |||
37 | 37 | ||
38 | static int page_size_mask; | 38 | static int page_size_mask; |
39 | 39 | ||
40 | void probe_page_size_mask(void) | 40 | static void __init probe_page_size_mask(void) |
41 | { | 41 | { |
42 | #if !defined(CONFIG_DEBUG_PAGEALLOC) && !defined(CONFIG_KMEMCHECK) | 42 | #if !defined(CONFIG_DEBUG_PAGEALLOC) && !defined(CONFIG_KMEMCHECK) |
43 | /* | 43 | /* |
@@ -315,6 +315,23 @@ unsigned long __init_refok init_memory_mapping(unsigned long start, | |||
315 | return ret >> PAGE_SHIFT; | 315 | return ret >> PAGE_SHIFT; |
316 | } | 316 | } |
317 | 317 | ||
318 | void __init init_mem_mapping(void) | ||
319 | { | ||
320 | probe_page_size_mask(); | ||
321 | |||
322 | /* max_pfn_mapped is updated here */ | ||
323 | max_low_pfn_mapped = init_memory_mapping(0, max_low_pfn<<PAGE_SHIFT); | ||
324 | max_pfn_mapped = max_low_pfn_mapped; | ||
325 | |||
326 | #ifdef CONFIG_X86_64 | ||
327 | if (max_pfn > max_low_pfn) { | ||
328 | max_pfn_mapped = init_memory_mapping(1UL<<32, | ||
329 | max_pfn<<PAGE_SHIFT); | ||
330 | /* can we preseve max_low_pfn ?*/ | ||
331 | max_low_pfn = max_pfn; | ||
332 | } | ||
333 | #endif | ||
334 | } | ||
318 | 335 | ||
319 | /* | 336 | /* |
320 | * devmem_is_allowed() checks to see if /dev/mem access to a certain address | 337 | * devmem_is_allowed() checks to see if /dev/mem access to a certain address |