Skip to content

Commit

Permalink
x86: fix pte allocation in "x86: introduce init_memory_mapping for 32…
Browse files Browse the repository at this point in the history
…bit"

The patch "x86: introduce init_memory_mapping for 32bit" does not allocate
enough space for PTEs if the CPU does not implement PSE.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Acked-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Jeremy Fitzhardinge authored and Ingo Molnar committed Jul 8, 2008
1 parent 9f9d489 commit 8207c25
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions arch/x86/mm/init_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,11 @@ static void __init find_early_table_space(unsigned long end)
pmds = (end + PMD_SIZE - 1) >> PMD_SHIFT;
tables += PAGE_ALIGN(pmds * sizeof(pmd_t));

if (!cpu_has_pse) {
int ptes = (end + PAGE_SIZE - 1) >> PAGE_SHIFT;
tables += PAGE_ALIGN(ptes * sizeof(pte_t));
}

/*
* RED-PEN putting page tables only on node 0 could
* cause a hotspot and fill up ZONE_DMA. The page tables
Expand Down

0 comments on commit 8207c25

Please sign in to comment.