Skip to content

Commit

Permalink
ARM: fix alignment of keystone page table fixup
Browse files Browse the repository at this point in the history
If init_mm.brk is not section aligned, the LPAE fixup code will miss
updating the final PMD.  Fix this by aligning map_end.

Fixes: a77e0c7 ("ARM: mm: Recreate kernel mappings in early_paging_init()")
Cc: <stable@vger.kernel.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Russell King committed Jul 29, 2014
1 parent 91942d1 commit 823a19c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions arch/arm/mm/mmu.c
Original file line number Diff line number Diff line change
@@ -1406,8 +1406,8 @@ void __init early_paging_init(const struct machine_desc *mdesc,
return;

/* remap kernel code and data */
map_start = init_mm.start_code;
map_end = init_mm.brk;
map_start = init_mm.start_code & PMD_MASK;
map_end = ALIGN(init_mm.brk, PMD_SIZE);

/* get a handle on things... */
pgd0 = pgd_offset_k(0);
@@ -1442,7 +1442,7 @@ void __init early_paging_init(const struct machine_desc *mdesc,
}

/* remap pmds for kernel mapping */
phys = __pa(map_start) & PMD_MASK;
phys = __pa(map_start);
do {
*pmdk++ = __pmd(phys | pmdprot);
phys += PMD_SIZE;

0 comments on commit 823a19c

Please sign in to comment.