diff options
author | Marcin Nowakowski <marcin.nowakowski@imgtec.com> | 2017-04-11 03:00:34 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2017-06-08 08:51:58 -0400 |
commit | 71eb989ab5a110df8bcbb9609bacde73feacbedd (patch) | |
tree | 872144f38e6b157976533c74cc37eb220c5a59ee | |
parent | f7a31b5e7874f77464a4eae0a8ba84b9ae0b3a54 (diff) |
MIPS: mm: fixed mappings: correct initialisation
fixrange_init operates at PMD-granularity and expects the addresses to
be PMD-size aligned, but currently that might not be the case for
PKMAP_BASE unless it is defined properly, so ensure a correct alignment
is used before passing the address to fixrange_init.
fixed mappings: only align the start address that is passed to
fixrange_init rather than the value before adding the size, as we may
end up with uninitialised upper part of the range.
Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/15948/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r-- | arch/mips/mm/pgtable-32.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/mips/mm/pgtable-32.c b/arch/mips/mm/pgtable-32.c index adc6911ba748..b19a3c506b1e 100644 --- a/arch/mips/mm/pgtable-32.c +++ b/arch/mips/mm/pgtable-32.c | |||
@@ -51,15 +51,15 @@ void __init pagetable_init(void) | |||
51 | /* | 51 | /* |
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); |
55 | fixrange_init(vaddr, vaddr + FIXADDR_SIZE, pgd_base); | 55 | fixrange_init(vaddr & PMD_MASK, vaddr + FIXADDR_SIZE, pgd_base); |
56 | 56 | ||
57 | #ifdef CONFIG_HIGHMEM | 57 | #ifdef CONFIG_HIGHMEM |
58 | /* | 58 | /* |
59 | * Permanent kmaps: | 59 | * Permanent kmaps: |
60 | */ | 60 | */ |
61 | vaddr = PKMAP_BASE; | 61 | vaddr = PKMAP_BASE; |
62 | fixrange_init(vaddr, vaddr + PAGE_SIZE*LAST_PKMAP, pgd_base); | 62 | fixrange_init(vaddr & PMD_MASK, vaddr + PAGE_SIZE*LAST_PKMAP, pgd_base); |
63 | 63 | ||
64 | pgd = swapper_pg_dir + __pgd_offset(vaddr); | 64 | pgd = swapper_pg_dir + __pgd_offset(vaddr); |
65 | pud = pud_offset(pgd, vaddr); | 65 | pud = pud_offset(pgd, vaddr); |