diff options
author | mchourasia <mchourasia@nvidia.com> | 2011-03-30 18:53:45 +0530 |
---|---|---|
committer | Niket Sirsi <nsirsi@nvidia.com> | 2011-06-13 20:01:44 -0700 |
commit | 97c7cf7a955d6be405209a18f5de519986f00310 (patch) | |
tree | bd71eb0aeeab1a057181f5da9943d67c08ae5c61 /arch/arm/mm/mmu.c | |
parent | 283712452f12b41c516b7434b523098bb29c41df (diff) |
arm: Fix for highmem detection
sanity_check_meminfo walks over the registered memory banks and attempts
to split banks across lowmem and highmem when they would otherwise
overlap with the vmalloc space.
The checks to determine whether or not a bank belongs to highmem
or not only check if __va(bank->start) is greater or less than
vmalloc_min. In the case that it is equal, the bank is incorrectly
treated as lowmem, which hoses the vmalloc area.
This patch fixes the issue by checking whether the virtual
start address of a bank is >= vmalloc_min
Similar fix is there in Linus' kernel tree for 3.0.0-rc2.
commit 40f7bfe4f1c2761abeceb3b2b9dc1feec3c47ed9
bug 807934
(cherry picked from commit 316bd372c8aa7513ea6dcc9b3f6ecb487de96a2a)
Change-Id: I1ffdaa5fb4c7c44c34d4a238e7e5e790eea572fc
Reviewed-on: http://git-master/r/34700
Tested-by: Manoj Chourasia <mchourasia@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'arch/arm/mm/mmu.c')
-rw-r--r-- | arch/arm/mm/mmu.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index 35f8431a802b..fa2637b5479a 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c @@ -761,7 +761,13 @@ static void __init sanity_check_meminfo(void) *bank = meminfo.bank[i]; #ifdef CONFIG_HIGHMEM - if (__va(bank->start) > vmalloc_min || + + /* + * In case where memory banks which are completely overlapping + * with vmalloc area, the banks need to be marked in highmem. + */ + + if (__va(bank->start) >= vmalloc_min || __va(bank->start) < (void *)PAGE_OFFSET) highmem = 1; @@ -771,6 +777,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 && bank->size > vmalloc_min - __va(bank->start)) { if (meminfo.nr_banks >= NR_BANKS) { |