From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754181Ab1AXR6I (ORCPT ); Mon, 24 Jan 2011 12:58:08 -0500 Received: from service87.mimecast.com ([94.185.240.25]:51394 "HELO service87.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1754044Ab1AXR4c (ORCPT ); Mon, 24 Jan 2011 12:56:32 -0500 From: Catalin Marinas To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Will Deacon Subject: [PATCH v4 17/19] ARM: LPAE: mark memory banks with start > ULONG_MAX as highmem Date: Mon, 24 Jan 2011 17:55:59 +0000 Message-Id: <1295891761-18366-18-git-send-email-catalin.marinas@arm.com> X-Mailer: git-send-email 1.7.3.2.164.g6f10c.dirty In-Reply-To: <1295891761-18366-1-git-send-email-catalin.marinas@arm.com> References: <1295891761-18366-1-git-send-email-catalin.marinas@arm.com> X-OriginalArrivalTime: 24 Jan 2011 17:56:15.0600 (UTC) FILETIME=[FEC39700:01CBBBEF] X-MC-Unique: 111012417562907301 Content-Type: text/plain; charset=WINDOWS-1252 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id p0OHwgJS031593 From: Will Deacon 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 --- arch/arm/mm/mmu.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index a1d8a07..8a55be4 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c @@ -782,7 +782,8 @@ static void __init sanity_check_meminfo(void) #ifdef CONFIG_HIGHMEM if (__va(bank->start) > vmalloc_min || - __va(bank->start) < (void *)PAGE_OFFSET) + __va(bank->start) < (void *)PAGE_OFFSET || + bank->start > ULONG_MAX) highmem = 1; bank->highmem = highmem; @@ -791,7 +792,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, "