aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/mm/init.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
index d7aea41563b3..7d7a36d645d3 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -45,11 +45,15 @@ static void __init find_early_table_space(struct map_range *mr, int nr_range)
45 int i; 45 int i;
46 unsigned long puds = 0, pmds = 0, ptes = 0, tables; 46 unsigned long puds = 0, pmds = 0, ptes = 0, tables;
47 unsigned long start = 0, good_end; 47 unsigned long start = 0, good_end;
48 unsigned long pgd_extra = 0;
48 phys_addr_t base; 49 phys_addr_t base;
49 50
50 for (i = 0; i < nr_range; i++) { 51 for (i = 0; i < nr_range; i++) {
51 unsigned long range, extra; 52 unsigned long range, extra;
52 53
54 if ((mr[i].end >> PGDIR_SHIFT) - (mr[i].start >> PGDIR_SHIFT))
55 pgd_extra++;
56
53 range = mr[i].end - mr[i].start; 57 range = mr[i].end - mr[i].start;
54 puds += (range + PUD_SIZE - 1) >> PUD_SHIFT; 58 puds += (range + PUD_SIZE - 1) >> PUD_SHIFT;
55 59
@@ -74,6 +78,7 @@ static void __init find_early_table_space(struct map_range *mr, int nr_range)
74 tables = roundup(puds * sizeof(pud_t), PAGE_SIZE); 78 tables = roundup(puds * sizeof(pud_t), PAGE_SIZE);
75 tables += roundup(pmds * sizeof(pmd_t), PAGE_SIZE); 79 tables += roundup(pmds * sizeof(pmd_t), PAGE_SIZE);
76 tables += roundup(ptes * sizeof(pte_t), PAGE_SIZE); 80 tables += roundup(ptes * sizeof(pte_t), PAGE_SIZE);
81 tables += (pgd_extra * PAGE_SIZE);
77 82
78#ifdef CONFIG_X86_32 83#ifdef CONFIG_X86_32
79 /* for fixmap */ 84 /* for fixmap */