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: 57127 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp1318938lbb; Mon, 23 Nov 2015 01:16:12 -0800 (PST) X-Received: by 10.67.1.103 with SMTP id bf7mr34635601pad.147.1448270172681; Mon, 23 Nov 2015 01:16:12 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id kj7si18026301pab.5.2015.11.23.01.16.12 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Nov 2015 01:16:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dkim=neutral (body hash did not verify) header.i=@linaro-org.20150623.gappssmtp.com 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-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c09:0:0:0:235 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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+patch=linaro.org@lists.infradead.org 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(-) -- 1.9.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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)