|
@@ -370,7 +370,14 @@ phys_pud_init(pud_t *pud_page, unsigned long addr, unsigned long end)
|
|
}
|
|
}
|
|
|
|
|
|
if (pud_val(*pud)) {
|
|
if (pud_val(*pud)) {
|
|
- phys_pmd_update(pud, addr, end);
|
|
|
|
|
|
+ if (!pud_large(*pud))
|
|
|
|
+ phys_pmd_update(pud, addr, end);
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (direct_gbpages) {
|
|
|
|
+ set_pte((pte_t *)pud,
|
|
|
|
+ pfn_pte(addr >> PAGE_SHIFT, PAGE_KERNEL_LARGE));
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -391,9 +398,11 @@ static void __init find_early_table_space(unsigned long end)
|
|
unsigned long puds, pmds, tables, start;
|
|
unsigned long puds, pmds, tables, start;
|
|
|
|
|
|
puds = (end + PUD_SIZE - 1) >> PUD_SHIFT;
|
|
puds = (end + PUD_SIZE - 1) >> PUD_SHIFT;
|
|
- pmds = (end + PMD_SIZE - 1) >> PMD_SHIFT;
|
|
|
|
- tables = round_up(puds * sizeof(pud_t), PAGE_SIZE) +
|
|
|
|
- round_up(pmds * sizeof(pmd_t), PAGE_SIZE);
|
|
|
|
|
|
+ tables = round_up(puds * sizeof(pud_t), PAGE_SIZE);
|
|
|
|
+ if (!direct_gbpages) {
|
|
|
|
+ pmds = (end + PMD_SIZE - 1) >> PMD_SHIFT;
|
|
|
|
+ tables += round_up(pmds * sizeof(pmd_t), PAGE_SIZE);
|
|
|
|
+ }
|
|
|
|
|
|
/*
|
|
/*
|
|
* RED-PEN putting page tables only on node 0 could
|
|
* RED-PEN putting page tables only on node 0 could
|
|
@@ -413,6 +422,14 @@ static void __init find_early_table_space(unsigned long end)
|
|
(table_start << PAGE_SHIFT) + tables);
|
|
(table_start << PAGE_SHIFT) + tables);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static void __init init_gbpages(void)
|
|
|
|
+{
|
|
|
|
+ if (direct_gbpages && cpu_has_gbpages)
|
|
|
|
+ printk(KERN_INFO "Using GB pages for direct mapping\n");
|
|
|
|
+ else
|
|
|
|
+ direct_gbpages = 0;
|
|
|
|
+}
|
|
|
|
+
|
|
/*
|
|
/*
|
|
* Setup the direct mapping of the physical memory at PAGE_OFFSET.
|
|
* Setup the direct mapping of the physical memory at PAGE_OFFSET.
|
|
* This runs before bootmem is initialized and gets pages directly from
|
|
* This runs before bootmem is initialized and gets pages directly from
|
|
@@ -431,8 +448,10 @@ void __init_refok init_memory_mapping(unsigned long start, unsigned long end)
|
|
* memory mapped. Unfortunately this is done currently before the
|
|
* memory mapped. Unfortunately this is done currently before the
|
|
* nodes are discovered.
|
|
* nodes are discovered.
|
|
*/
|
|
*/
|
|
- if (!after_bootmem)
|
|
|
|
|
|
+ if (!after_bootmem) {
|
|
|
|
+ init_gbpages();
|
|
find_early_table_space(end);
|
|
find_early_table_space(end);
|
|
|
|
+ }
|
|
|
|
|
|
start = (unsigned long)__va(start);
|
|
start = (unsigned long)__va(start);
|
|
end = (unsigned long)__va(end);
|
|
end = (unsigned long)__va(end);
|