From patchwork Mon Nov 23 09:06:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 57115 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp1315694lbb; Mon, 23 Nov 2015 01:09:12 -0800 (PST) X-Received: by 10.68.129.133 with SMTP id nw5mr34302243pbb.18.1448269752013; Mon, 23 Nov 2015 01:09:12 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id q196si18066340pfq.192.2015.11.23.01.09.11 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Nov 2015 01:09: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 1a0n5n-0003Mj-QU; Mon, 23 Nov 2015 09:07:23 +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 1a0n5d-0003GC-Fa for linux-arm-kernel@lists.infradead.org; Mon, 23 Nov 2015 09:07:15 +0000 Received: by wmuu63 with SMTP id u63so44703491wmu.0 for ; Mon, 23 Nov 2015 01:06:55 -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=VYKFeArm10XJhGEEpK3WSYU7OGSsYFX4oS8JJpUFsYc=; b=J/x0peV0jaFbtsfJ5jmA7e4bQmy9rI0bTAz54xNfKcjuquiwH8rQN/Q3GY2vl+3kQq udzBWQuqGrlUeRvg4TKnDSBJQ+7pBL5fpRWsxSs85e2DyW885gJUHPZzkVGv2PXV/ww7 +Jtf5q2BMju6IAdTxCS0qHqu9R1bHAu/I8/RdbCTar+FcP8STz2WqOaBYFehKwPjvNUG gmZkA9Bo0kSjTs9uyXB9rhhHGb8vEjL9F5BL23SWDCJvigpQMq00ioA+9i14uY02XnTo xJ0cScxBy/kqSUyxbyxstNEyk4RFb343RUfb8UhoEdTX7JhBD5qX3QUAd4uR5l1me0iA anYg== 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=VYKFeArm10XJhGEEpK3WSYU7OGSsYFX4oS8JJpUFsYc=; b=culGlSv9PNTjimskr/kqlBT9ofi9QcnRaGG/QJdfp0RWOOHQQTCSwKquRwoi6Z1KEI jZ1CwQZX5itFzhNXENzW4tCzi7fy1IeldcjPD2JjjtihF6DTsyttEEF3RMz21re9LmVU YXZt5/nqT4/SFbHM09E5R1d85RMmsW4A7UnQewVadPaE+YO2YcBjmDi/zEZ7qGab+AMj hWRsXZRO2jYdHOzRE0r6Mem3U6kbszXFIkokliEMTbX6S/QyrgX07uRtnrtlLjOcM7tf DGP/S4G/f+ybj6SZRHrbqSBbF9/uQxjujc6AoMlp4Ui1AidsljCXLcxjT4TBkEt7oo67 RLYQ== X-Gm-Message-State: ALoCoQnfoAd8nfyYq2Epdj+HayozB5vqSV8XPWZYIiw0tI6iB03y05+U4PNarFCRi6s9qP7uOd0U X-Received: by 10.194.243.227 with SMTP id xb3mr31595137wjc.96.1448269615307; Mon, 23 Nov 2015 01:06:55 -0800 (PST) Received: from localhost.localdomain ([2.44.140.166]) by smtp.gmail.com with ESMTPSA id h189sm12241754wme.1.2015.11.23.01.06.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 23 Nov 2015 01:06:54 -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 02/13] arm64: only consider memblocks with NOMAP cleared for linear mapping Date: Mon, 23 Nov 2015 10:06:22 +0100 Message-Id: <1448269593-20758-3-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_010713_804257_56EF0A39 X-CRM114-Status: GOOD ( 12.60 ) 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: 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/arm64/mm/init.c | 2 +- arch/arm64/mm/mmu.c | 2 ++ 2 files changed, 3 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/arm64/mm/init.c b/arch/arm64/mm/init.c index 17bf39ac83ba..ac4d7cbbdd2d 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -120,7 +120,7 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max) #ifdef CONFIG_HAVE_ARCH_PFN_VALID int pfn_valid(unsigned long pfn) { - return memblock_is_memory(pfn << PAGE_SHIFT); + return memblock_is_map_memory(pfn << PAGE_SHIFT); } EXPORT_SYMBOL(pfn_valid); #endif diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index abb66f84d4ac..4d75525e20be 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -421,6 +421,8 @@ static void __init map_mem(void) if (start >= end) break; + if (memblock_is_nomap(reg)) + continue; if (ARM64_SWAPPER_USES_SECTION_MAPS) { /*