]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ARM: LPAE: mark memory banks with start > ULONG_MAX as highmem
authorWill Deacon <will.deacon@arm.com>
Mon, 31 Jan 2011 13:50:46 +0000 (13:50 +0000)
committerCatalin Marinas <catalin.marinas@arm.com>
Tue, 14 Jun 2011 13:43:59 +0000 (14:43 +0100)
Memory banks living outside of the 32-bit physical address
space do not have a 1:1 pa <-> va mapping and therefore the
__va macro may wrap.

This patch ensures that such banks are marked as highmem so
that the Kernel doesn't try to split them up when it sees that
the wrapped virtual address overlaps the vmalloc space.

Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm/mm/mmu.c

index d56f918a619329e5ca533e23a0a6703bf9a36f75..f02f9a035eb3f0430a769673dde2c1cb5d126bd7 100644 (file)
@@ -790,7 +790,8 @@ static void __init sanity_check_meminfo(void)
                *bank = meminfo.bank[i];
 
 #ifdef CONFIG_HIGHMEM
-               if (__va(bank->start) >= vmalloc_min ||
+               if (bank->start > ULONG_MAX ||
+                   __va(bank->start) >= vmalloc_min ||
                    __va(bank->start) < (void *)PAGE_OFFSET)
                        highmem = 1;
 
@@ -800,7 +801,7 @@ static void __init sanity_check_meminfo(void)
                 * Split those memory banks which are partially overlapping
                 * the vmalloc area greatly simplifying things later.
                 */
-               if (__va(bank->start) < vmalloc_min &&
+               if (!highmem && __va(bank->start) < vmalloc_min &&
                    bank->size > vmalloc_min - __va(bank->start)) {
                        if (meminfo.nr_banks >= NR_BANKS) {
                                printk(KERN_CRIT "NR_BANKS too low, "