diff options
author | Kevin Cernekee <cernekee@gmail.com> | 2011-01-06 02:31:30 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2011-07-25 12:26:54 -0400 |
commit | 464fd83e841a16f4ea1325b33eb08170ef5cd1f4 (patch) | |
tree | 2e182c5da3bf09701e048ec7edef90665feb9f44 /arch/mips | |
parent | 273f2d7e64f9fd22192b4cd31e7408284a721e69 (diff) |
MIPS: Limit fixrange_init() to the FIXMAP region
fixrange_init() allocates page tables for all addresses higher than
FIXADDR_TOP. On processors that override the default FIXADDR_TOP
address of 0xfffe_0000, this can consume up to 4 pages (1 page per 4MB)
for pgd's that are never used.
Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/1980/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips')
-rw-r--r-- | arch/mips/mm/init.c | 6 | ||||
-rw-r--r-- | arch/mips/mm/pgtable-32.c | 2 | ||||
-rw-r--r-- | arch/mips/mm/pgtable-64.c | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c index 11689e1a2924..b7ebc4fa89bc 100644 --- a/arch/mips/mm/init.c +++ b/arch/mips/mm/init.c | |||
@@ -277,11 +277,11 @@ void __init fixrange_init(unsigned long start, unsigned long end, | |||
277 | k = __pmd_offset(vaddr); | 277 | k = __pmd_offset(vaddr); |
278 | pgd = pgd_base + i; | 278 | pgd = pgd_base + i; |
279 | 279 | ||
280 | for ( ; (i < PTRS_PER_PGD) && (vaddr != end); pgd++, i++) { | 280 | for ( ; (i < PTRS_PER_PGD) && (vaddr < end); pgd++, i++) { |
281 | pud = (pud_t *)pgd; | 281 | pud = (pud_t *)pgd; |
282 | for ( ; (j < PTRS_PER_PUD) && (vaddr != end); pud++, j++) { | 282 | for ( ; (j < PTRS_PER_PUD) && (vaddr < end); pud++, j++) { |
283 | pmd = (pmd_t *)pud; | 283 | pmd = (pmd_t *)pud; |
284 | for (; (k < PTRS_PER_PMD) && (vaddr != end); pmd++, k++) { | 284 | for (; (k < PTRS_PER_PMD) && (vaddr < end); pmd++, k++) { |
285 | if (pmd_none(*pmd)) { | 285 | if (pmd_none(*pmd)) { |
286 | pte = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE); | 286 | pte = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE); |
287 | set_pmd(pmd, __pmd((unsigned long)pte)); | 287 | set_pmd(pmd, __pmd((unsigned long)pte)); |
diff --git a/arch/mips/mm/pgtable-32.c b/arch/mips/mm/pgtable-32.c index 575e4019227b..adc6911ba748 100644 --- a/arch/mips/mm/pgtable-32.c +++ b/arch/mips/mm/pgtable-32.c | |||
@@ -52,7 +52,7 @@ void __init pagetable_init(void) | |||
52 | * Fixed mappings: | 52 | * Fixed mappings: |
53 | */ | 53 | */ |
54 | vaddr = __fix_to_virt(__end_of_fixed_addresses - 1) & PMD_MASK; | 54 | vaddr = __fix_to_virt(__end_of_fixed_addresses - 1) & PMD_MASK; |
55 | fixrange_init(vaddr, 0, pgd_base); | 55 | fixrange_init(vaddr, vaddr + FIXADDR_SIZE, pgd_base); |
56 | 56 | ||
57 | #ifdef CONFIG_HIGHMEM | 57 | #ifdef CONFIG_HIGHMEM |
58 | /* | 58 | /* |
diff --git a/arch/mips/mm/pgtable-64.c b/arch/mips/mm/pgtable-64.c index 78eaa4f0b0ec..cda4e300eb0a 100644 --- a/arch/mips/mm/pgtable-64.c +++ b/arch/mips/mm/pgtable-64.c | |||
@@ -76,5 +76,5 @@ void __init pagetable_init(void) | |||
76 | * Fixed mappings: | 76 | * Fixed mappings: |
77 | */ | 77 | */ |
78 | vaddr = __fix_to_virt(__end_of_fixed_addresses - 1) & PMD_MASK; | 78 | vaddr = __fix_to_virt(__end_of_fixed_addresses - 1) & PMD_MASK; |
79 | fixrange_init(vaddr, 0, pgd_base); | 79 | fixrange_init(vaddr, vaddr + FIXADDR_SIZE, pgd_base); |
80 | } | 80 | } |