diff options
author | Will Deacon <will.deacon@arm.com> | 2011-11-22 12:30:32 -0500 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2011-12-08 05:33:28 -0500 |
commit | 77f73a2c8e869b035e71eea5cae07c30fe4bded0 (patch) | |
tree | 2f7f3488ecd409d872dc427e8050f97fc8fe5f27 | |
parent | ae2de101739c5a2a43a23a74a0d43aea810fb5a8 (diff) |
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 <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Nicolas Pitre <nico@linaro.org>
-rw-r--r-- | arch/arm/mm/mmu.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index 1935311e17fc..b836d6b2258b 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c | |||
@@ -799,6 +799,9 @@ void __init sanity_check_meminfo(void) | |||
799 | struct membank *bank = &meminfo.bank[j]; | 799 | struct membank *bank = &meminfo.bank[j]; |
800 | *bank = meminfo.bank[i]; | 800 | *bank = meminfo.bank[i]; |
801 | 801 | ||
802 | if (bank->start > ULONG_MAX) | ||
803 | highmem = 1; | ||
804 | |||
802 | #ifdef CONFIG_HIGHMEM | 805 | #ifdef CONFIG_HIGHMEM |
803 | if (__va(bank->start) >= vmalloc_min || | 806 | if (__va(bank->start) >= vmalloc_min || |
804 | __va(bank->start) < (void *)PAGE_OFFSET) | 807 | __va(bank->start) < (void *)PAGE_OFFSET) |
@@ -810,7 +813,7 @@ void __init sanity_check_meminfo(void) | |||
810 | * Split those memory banks which are partially overlapping | 813 | * Split those memory banks which are partially overlapping |
811 | * the vmalloc area greatly simplifying things later. | 814 | * the vmalloc area greatly simplifying things later. |
812 | */ | 815 | */ |
813 | if (__va(bank->start) < vmalloc_min && | 816 | if (!highmem && __va(bank->start) < vmalloc_min && |
814 | bank->size > vmalloc_min - __va(bank->start)) { | 817 | bank->size > vmalloc_min - __va(bank->start)) { |
815 | if (meminfo.nr_banks >= NR_BANKS) { | 818 | if (meminfo.nr_banks >= NR_BANKS) { |
816 | printk(KERN_CRIT "NR_BANKS too low, " | 819 | printk(KERN_CRIT "NR_BANKS too low, " |
@@ -831,6 +834,17 @@ void __init sanity_check_meminfo(void) | |||
831 | bank->highmem = highmem; | 834 | bank->highmem = highmem; |
832 | 835 | ||
833 | /* | 836 | /* |
837 | * Highmem banks not allowed with !CONFIG_HIGHMEM. | ||
838 | */ | ||
839 | if (highmem) { | ||
840 | printk(KERN_NOTICE "Ignoring RAM at %.8llx-%.8llx " | ||
841 | "(!CONFIG_HIGHMEM).\n", | ||
842 | (unsigned long long)bank->start, | ||
843 | (unsigned long long)bank->start + bank->size - 1); | ||
844 | continue; | ||
845 | } | ||
846 | |||
847 | /* | ||
834 | * Check whether this memory bank would entirely overlap | 848 | * Check whether this memory bank would entirely overlap |
835 | * the vmalloc area. | 849 | * the vmalloc area. |
836 | */ | 850 | */ |