Commit 2134c937 authored by Andrew Morton's avatar Andrew Morton Committed by Jaroslav Kysela

[PATCH] make sure all PMDs are allocated under PAE mode

Patch from Martin Bligh and Dave Hansen

If a PAE machine has 1G of memory and you set PAGE_OFFSET to 2G, the
kernel will only instantiate a PMD to cover the 2G-3G region.  But
another PMD is needed for the 3G-4G region for the APIC and possibly an
extended vmalloc region.

So the patch changes the code to instantiate PMDs out to the end of
physical memory.

It's a no-op for PAGE_OFFSET=3G, and _could_ be part of the
CONFIG_PAGE_OFFSET patch.  But it seems a reasonable generalisation
anyway.
parent b7fdef78
...@@ -134,8 +134,10 @@ static void __init kernel_physical_mapping_init(pgd_t *pgd_base) ...@@ -134,8 +134,10 @@ static void __init kernel_physical_mapping_init(pgd_t *pgd_base)
pgd = pgd_base + pgd_ofs; pgd = pgd_base + pgd_ofs;
pfn = 0; pfn = 0;
for (; pgd_ofs < PTRS_PER_PGD && pfn < max_low_pfn; pgd++, pgd_ofs++) { for (; pgd_ofs < PTRS_PER_PGD; pgd++, pgd_ofs++) {
pmd = one_md_table_init(pgd); pmd = one_md_table_init(pgd);
if (pfn >= max_low_pfn)
continue;
for (pmd_ofs = 0; pmd_ofs < PTRS_PER_PMD && pfn < max_low_pfn; pmd++, pmd_ofs++) { for (pmd_ofs = 0; pmd_ofs < PTRS_PER_PMD && pfn < max_low_pfn; pmd++, pmd_ofs++) {
/* Map with big pages if possible, otherwise create normal page tables. */ /* Map with big pages if possible, otherwise create normal page tables. */
if (cpu_has_pse) { if (cpu_has_pse) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment