From patchwork Mon Nov 23 09:06:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 7678251 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 45F4C9F1BE for ; Mon, 23 Nov 2015 09:16:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4E18F20623 for ; Mon, 23 Nov 2015 09:16:36 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 723372061D for ; Mon, 23 Nov 2015 09:16:35 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1a0nCw-0002Zx-36; Mon, 23 Nov 2015 09:14:46 +0000 Received: from mail-wm0-x235.google.com ([2a00:1450:400c:c09::235]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a0n6D-0003Nz-Px for linux-arm-kernel@lists.infradead.org; Mon, 23 Nov 2015 09:07:51 +0000 Received: by wmww144 with SMTP id w144so86943486wmw.1 for ; Mon, 23 Nov 2015 01:07:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=nDHZFKfXfRuy2vGNo8ufqlxoMW/R9e7AQLYq934zhZM=; b=QtpBzBiSSo4n1cuGbD7IXRKTpG4OTziEXKDtlSzGZQV3FEYk2RWpTMIEmo9/vNThsr 1sPbghxYyQWsAe1a/9OmZ+sliNtkXKA88rXkEM47f/MY3oyMTJlLVXK6tuEcGfKt/bH/ awXiCCh24FS8Msd541s06Ib9n8bKh28zUTOS6QCltibaHbSI7COsHZqZ2mXkE51p6LB4 Qll3rrtV33BsS2RxJQNZYvchfZ/ecOh1QSHZpRcloYTwqEAd5hggwNwnK5wbOZd2U4Z0 UxpFy4JNIw7YxZnr4wP0/UwYWJSNBrOGWUKNo4NOb1ct6wObzEsWFDRu2tQnEO6mQGAL 9RTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=nDHZFKfXfRuy2vGNo8ufqlxoMW/R9e7AQLYq934zhZM=; b=FV+kmy2LPF+RPfSixzT/GZrInInl/00uITBUe9siwXv6iXhO19LKhCyuYj3nq+bpKe zf/03UdGkGu52H7TjnPeq+8X6ilCFYP02esBK+Ng+QczrANkSNPEo/F+OWhkv0f0P6Ei 4ujBpM+k2TVqV9PkGOvTF8Hv27cerQnMhYdVeNDN9ctHLl+BiBzqYAjCYB5JJgSYhA/G qY21gqOiFlTeObKGsIJHdEbg4BbAwzhxelRXRcXq69yn5vg4kS4qgDJ9rNjSsiJCc4l1 hwQOD4EiVwQ1p3/YHELu2t71x++fHxAhuOPpSNDDNoIu+4PcwwZn2e5s9wd7u7BOUuRt DRrA== X-Gm-Message-State: ALoCoQlDFgxLJz1hFAKJMN+xPUcMjHuOReRSFTuggR6IEuFSkx7sttduiHWEWv6sO/Q6H+zq8obg X-Received: by 10.194.184.104 with SMTP id et8mr24437854wjc.87.1448269648102; Mon, 23 Nov 2015 01:07:28 -0800 (PST) Received: from localhost.localdomain ([2.44.140.166]) by smtp.gmail.com with ESMTPSA id h189sm12241754wme.1.2015.11.23.01.07.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 23 Nov 2015 01:07:27 -0800 (PST) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, will.deacon@arm.com, mark.rutland@arm.com, linux-efi@vger.kernel.org, leif.lindholm@linaro.org, matt@codeblueprint.co.uk Subject: [PATCH v3 11/13] ARM: only consider memblocks with NOMAP cleared for linear mapping Date: Mon, 23 Nov 2015 10:06:31 +0100 Message-Id: <1448269593-20758-12-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1448269593-20758-1-git-send-email-ard.biesheuvel@linaro.org> References: <1448269593-20758-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151123_010750_273104_665E8FD6 X-CRM114-Status: GOOD ( 13.38 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kuleshovmail@gmail.com, Ard Biesheuvel , roy.franz@linaro.org, linux-mm@kvack.org, ryan.harkin@linaro.org, msalter@redhat.com, grant.likely@linaro.org, akpm@linux-foundation.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Take the new memblock attribute MEMBLOCK_NOMAP into account when deciding whether a certain region is or should be covered by the kernel direct mapping. Signed-off-by: Ard Biesheuvel --- arch/arm/mm/init.c | 5 ++++- arch/arm/mm/mmu.c | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 8a63b4cdc0f2..16104b1e2661 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c @@ -191,7 +191,7 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max_low, #ifdef CONFIG_HAVE_ARCH_PFN_VALID int pfn_valid(unsigned long pfn) { - return memblock_is_memory(__pfn_to_phys(pfn)); + return memblock_is_map_memory(__pfn_to_phys(pfn)); } EXPORT_SYMBOL(pfn_valid); #endif @@ -432,6 +432,9 @@ static void __init free_highpages(void) if (end <= max_low) continue; + if (memblock_is_nomap(mem)) + continue; + /* Truncate partial highmem entries */ if (start < max_low) start = max_low; diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index 8c69830e791a..c615d2eb9232 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c @@ -1435,6 +1435,9 @@ static void __init map_lowmem(void) phys_addr_t end = start + reg->size; struct map_desc map; + if (memblock_is_nomap(reg)) + continue; + if (end > arm_lowmem_limit) end = arm_lowmem_limit; if (start >= end)