From: Will Deacon Date: Mon, 31 Jan 2011 13:50:46 +0000 (+0000) Subject: ARM: LPAE: mark memory banks with start > ULONG_MAX as highmem X-Git-Tag: next-20110810~70^2~3 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=5ddd229500f995ae106dde96fdf420237e192318;p=karo-tx-linux.git ARM: LPAE: mark memory banks with start > ULONG_MAX as highmem 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 Signed-off-by: Catalin Marinas --- diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index 1ba2a5ac14ac..85aa25e2727a 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c @@ -792,7 +792,8 @@ 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; @@ -802,7 +803,7 @@ 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, "