From patchwork Mon Nov 30 12:28:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 57438 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp1437737lbb; Mon, 30 Nov 2015 04:34:08 -0800 (PST) X-Received: by 10.98.72.71 with SMTP id v68mr71159989pfa.40.1448886848089; Mon, 30 Nov 2015 04:34:08 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id ul5si8444303pab.201.2015.11.30.04.34.07 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Nov 2015 04:34:08 -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 1a3Nd0-0007mc-WF; Mon, 30 Nov 2015 12:32:23 +0000 Received: from mail-wm0-x22a.google.com ([2a00:1450:400c:c09::22a]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a3Naf-0004UY-MF for linux-arm-kernel@lists.infradead.org; Mon, 30 Nov 2015 12:30:05 +0000 Received: by wmec201 with SMTP id c201so135839921wme.1 for ; Mon, 30 Nov 2015 04:29:36 -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=XSTJ0SGrx5f5Z0xNWAe8T0pPscPQaCcLe06TD08/g1I=; b=LLcyiQmLFsXfSTXw2dAVENWLGmwVD8sy6Gh630SnfO9HseVCUenXP/BSAnepRAnFsb JzI6cRx/YV7B8W73mNt98kTaWgEmP/YOhUPvsEJlel4lI6Ei+DaYumZ5xe0KVKxXGcMx sh03EPBDPVoLzzqqQZgS1eC2t4+goRyZsobfpL2dAGsvXMmRbHClJ+XQ9X4Zfl7k+bHA dTzrPRtOMCaQLbYErrrsEuPBpEFpsWrcjtouZMR9pNBWeDKtQyFbPOpiW80+TaJE3AlQ XXk4YQRxaeRh7PTeZI5ix5yh4Maln+zLfpUutexWjjk8DJGscW4F35k+cJcI4mxpptAM dxBA== 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=XSTJ0SGrx5f5Z0xNWAe8T0pPscPQaCcLe06TD08/g1I=; b=bNDDwheIHNnIKh//GhoEnmzrmnlgJ8xZkKU7FfqQ8OGfdU2wAYOgDta7UMHmpB4w0b /RiZ5bFb+LMEJdasz89KF9gZcByzAyTMNx+YlfZPKqTJuRRHGa3timgp1EdchMli/+Bt aXw+XrjkBGkCl88XpP8rNHJz8/iMXs7c5DC33/egrfZixaSRZyax0+r0bhqTqPQ8VKPk VPOfMoStQsP1Srfw5Lkb/WdI0LVk6sk0gB1ZoE7RxMn6wt7i+Yybd2JFiaOY27QwKcMu kojNGOvDrkaVtmBzE0jNKZav7oCpQwKiuQwUcvcpo3UP1t/xNre8pfPxgfE7A7uAsoTY MrKA== X-Gm-Message-State: ALoCoQmDrJ2H9Qc4UTUcavCq2/kLSOk2EPG7r8XVE+UIjVKmNE9vS3kSZ/5ffzNqaj6IllCWMC+T X-Received: by 10.194.92.229 with SMTP id cp5mr72663015wjb.163.1448886576047; Mon, 30 Nov 2015 04:29:36 -0800 (PST) Received: from localhost.localdomain (host2-115-static.225-95-b.business.telecomitalia.it. [95.225.115.2]) by smtp.gmail.com with ESMTPSA id d2sm46560361wjy.16.2015.11.30.04.29.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 30 Nov 2015 04:29:35 -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, linux@arm.linux.org.uk Subject: [PATCH v4 11/13] ARM: only consider memblocks with NOMAP cleared for linear mapping Date: Mon, 30 Nov 2015 13:28:25 +0100 Message-Id: <1448886507-3216-12-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1448886507-3216-1-git-send-email-ard.biesheuvel@linaro.org> References: <1448886507-3216-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151130_042958_617127_5835C7FB X-CRM114-Status: GOOD ( 12.99 ) 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:22a 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. Tested-by: Ryan Harkin Reviewed-by: Matt Fleming 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)