aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm
diff options
context:
space:
mode:
authorDave Young <dyoung@redhat.com>2012-10-18 02:33:23 -0400
committerIngo Molnar <mingo@kernel.org>2012-10-24 03:38:25 -0400
commit7b16bbf97375d9fb7fc107b3f80afeb94a204e44 (patch)
tree9c921175f1f27efdc909658195e9d02252b36d07 /arch/x86/mm
parent0e9e3e306c7e472bdcffa34c4c4584301eda03b3 (diff)
Revert "x86/mm: Fix the size calculation of mapping tables"
Commit: 722bc6b16771 x86/mm: Fix the size calculation of mapping tables Tried to address the issue that the first 2/4M should use 4k pages if PSE enabled, but extra counts should only be valid for x86_32. This commit caused a kdump regression: the kdump kernel hangs. Work is in progress to fundamentally fix the various page table initialization issues that we have, via the design suggested by H. Peter Anvin, but it's not ready yet to be merged. So, to get a working kdump revert to the last known working version, which is the revert of this commit and of a followup fix (which was incomplete): bd2753b2dda7 x86/mm: Only add extra pages count for the first memory range during pre-allocation Tested kdump on physical and virtual machines. Signed-off-by: Dave Young <dyoung@redhat.com> Acked-by: Yinghai Lu <yinghai@kernel.org> Acked-by: Cong Wang <xiyou.wangcong@gmail.com> Acked-by: Flavio Leitner <fbl@redhat.com> Tested-by: Flavio Leitner <fbl@redhat.com> Cc: Dan Carpenter <dan.carpenter@oracle.com> Cc: Cong Wang <xiyou.wangcong@gmail.com> Cc: Flavio Leitner <fbl@redhat.com> Cc: Tejun Heo <tj@kernel.org> Cc: ianfang.cn@gmail.com Cc: Vivek Goyal <vgoyal@redhat.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: <stable@kernel.org> Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/mm')
-rw-r--r--arch/x86/mm/init.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
index ab1f6a93b527..8653b3a722be 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -29,14 +29,8 @@ int direct_gbpages
29#endif 29#endif
30; 30;
31 31
32struct map_range { 32static void __init find_early_table_space(unsigned long end, int use_pse,
33 unsigned long start; 33 int use_gbpages)
34 unsigned long end;
35 unsigned page_size_mask;
36};
37
38static void __init find_early_table_space(struct map_range *mr, unsigned long end,
39 int use_pse, int use_gbpages)
40{ 34{
41 unsigned long puds, pmds, ptes, tables, start = 0, good_end = end; 35 unsigned long puds, pmds, ptes, tables, start = 0, good_end = end;
42 phys_addr_t base; 36 phys_addr_t base;
@@ -61,10 +55,6 @@ static void __init find_early_table_space(struct map_range *mr, unsigned long en
61#ifdef CONFIG_X86_32 55#ifdef CONFIG_X86_32
62 extra += PMD_SIZE; 56 extra += PMD_SIZE;
63#endif 57#endif
64 /* The first 2/4M doesn't use large pages. */
65 if (mr->start < PMD_SIZE)
66 extra += mr->end - mr->start;
67
68 ptes = (extra + PAGE_SIZE - 1) >> PAGE_SHIFT; 58 ptes = (extra + PAGE_SIZE - 1) >> PAGE_SHIFT;
69 } else 59 } else
70 ptes = (end + PAGE_SIZE - 1) >> PAGE_SHIFT; 60 ptes = (end + PAGE_SIZE - 1) >> PAGE_SHIFT;
@@ -95,6 +85,12 @@ void __init native_pagetable_reserve(u64 start, u64 end)
95 memblock_reserve(start, end - start); 85 memblock_reserve(start, end - start);
96} 86}
97 87
88struct map_range {
89 unsigned long start;
90 unsigned long end;
91 unsigned page_size_mask;
92};
93
98#ifdef CONFIG_X86_32 94#ifdef CONFIG_X86_32
99#define NR_RANGE_MR 3 95#define NR_RANGE_MR 3
100#else /* CONFIG_X86_64 */ 96#else /* CONFIG_X86_64 */
@@ -267,7 +263,7 @@ unsigned long __init_refok init_memory_mapping(unsigned long start,
267 * nodes are discovered. 263 * nodes are discovered.
268 */ 264 */
269 if (!after_bootmem) 265 if (!after_bootmem)
270 find_early_table_space(&mr[0], end, use_pse, use_gbpages); 266 find_early_table_space(end, use_pse, use_gbpages);
271 267
272 for (i = 0; i < nr_range; i++) 268 for (i = 0; i < nr_range; i++)
273 ret = kernel_physical_mapping_init(mr[i].start, mr[i].end, 269 ret = kernel_physical_mapping_init(mr[i].start, mr[i].end,