]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
ARM: fix alignment of keystone page table fixup
authorRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 29 Jul 2014 08:24:47 +0000 (09:24 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 29 Jul 2014 10:41:54 +0000 (11:41 +0100)
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: a77e0c7b2774 ("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>
arch/arm/mm/mmu.c

index ab14b79b03f0d4b573f89d34f38b005d31d4cff5..6e3ba8d112a2e534d2ca42ed2f4e8dc388f3f452 100644 (file)
@@ -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;