From patchwork Mon Nov 16 18:32:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 56681 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp1485393lbb; Mon, 16 Nov 2015 10:41:36 -0800 (PST) X-Received: by 10.50.107.3 with SMTP id gy3mr16742962igb.48.1447699296194; Mon, 16 Nov 2015 10:41:36 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id m26si18737209ioi.105.2015.11.16.10.41.35 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Nov 2015 10:41:36 -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 1ZyOhG-0006WF-Su; Mon, 16 Nov 2015 18:40:10 +0000 Received: from mail-wm0-x236.google.com ([2a00:1450:400c:c09::236]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZyOao-0007Xn-I2 for linux-arm-kernel@lists.infradead.org; Mon, 16 Nov 2015 18:33:31 +0000 Received: by wmec201 with SMTP id c201so133347740wme.1 for ; Mon, 16 Nov 2015 10:33:09 -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=sO8M7wUamnTczAYTMXfCbpSMbK8YHmvtPtEKOLd2p4c=; b=gYlGLCF0Ww4cdJk5yA/5ksEU4YVNhvOjWdh9ngM81cb5oRm1qRUhmv/eMFIMW1ekfF n5bDcDQgqvmY9OhdvAqhIYygvX+9a1mgpK33iL7tPThOf2e/oH6x+VivOjBtQRtU0C0E GbPvlSEKTN1l8Sc1Rek9sqrt+szzxT1Xzr2+e8SctE91pxF5jYswloz6pklp/kGCYCLy 38UFD4oJb+u2AN8LAQXs9q8FDOhFjguoZ/wqXxtipxdMASo78jeTVVoBcdDuEiCAwyp0 xW+yyw19qPxKkZWTwR6Xk9qWUSYZzNx5JmL0ldckYuV9ukAsVKcEWqd/P8HKpkl0qOpX uiHg== 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=sO8M7wUamnTczAYTMXfCbpSMbK8YHmvtPtEKOLd2p4c=; b=LLWQV7fnMRANQZxr+R7hy0BRXpaqZmyhRB8fkUOyqyzvmEhfMH+src42PgTev3PuM9 gEpIv6XtwXf0lhBjuunreU/RSBGmgwjKnmD7WqdVE5xnHKFbwh8SOgaHcsalKTGyXyGM gmqz7LsJx5j6HWl2pXrGz9aNl6bT8Y+RtKt3NXUmBaAq1rNmlxZ9M5DfzyTkqCZnYZ1r hetEsgTOY/p8oju74oEu/QfB+Wgk8jBue4MENqg3NyEHt6D5bKd/lTXkZ06vkToVm15Q N1iM7aElovXaoiSCoL0iYlWEhKapdXdGSuc4/F/Ttd3HpSThxLwGqEC/VvPWhDoQQOsy tgTw== X-Gm-Message-State: ALoCoQl017x2Zr7iVx5peMCA08gzzb0JQD5jEGMAvEoMMZZHoYkVxpFhlSgzNp7cDLHoMbwoOm7/ X-Received: by 10.194.93.164 with SMTP id cv4mr27464878wjb.43.1447698789033; Mon, 16 Nov 2015 10:33:09 -0800 (PST) Received: from ards-macbook-pro.lan (2-237-3-18.ip236.fastwebnet.it. [2.237.3.18]) by smtp.gmail.com with ESMTPSA id he3sm35796779wjc.48.2015.11.16.10.33.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Nov 2015 10:33:08 -0800 (PST) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, linux-efi@vger.kernel.org, matt.fleming@intel.com, linux@arm.linux.org.uk, will.deacon@arm.com, grant.likely@linaro.org, catalin.marinas@arm.com, mark.rutland@arm.com, leif.lindholm@linaro.org, roy.franz@linaro.org Subject: [PATCH v2 10/12] ARM: only consider memblocks with NOMAP cleared for linear mapping Date: Mon, 16 Nov 2015 19:32:35 +0100 Message-Id: <1447698757-8762-11-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1447698757-8762-1-git-send-email-ard.biesheuvel@linaro.org> References: <1447698757-8762-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151116_103330_974625_D5EE2108 X-CRM114-Status: GOOD ( 13.19 ) 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:236 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: linux-mm@kvack.org, ryan.harkin@linaro.org, Ard Biesheuvel , akpm@linux-foundation.org, msalter@redhat.com 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 0b7b61e31bc3..094e550144b3 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c @@ -1429,6 +1429,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)