From patchwork Mon Nov 16 18:32:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 56672 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp1481605lbb; Mon, 16 Nov 2015 10:35:16 -0800 (PST) X-Received: by 10.66.227.102 with SMTP id rz6mr57415643pac.4.1447698916839; Mon, 16 Nov 2015 10:35:16 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id ra10si52074527pbc.126.2015.11.16.10.35.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Nov 2015 10:35:16 -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 1ZyObA-000879-3N; Mon, 16 Nov 2015 18:33:52 +0000 Received: from mail-wm0-x229.google.com ([2a00:1450:400c:c09::229]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZyOaW-0007PB-Gz for linux-arm-kernel@lists.infradead.org; Mon, 16 Nov 2015 18:33:14 +0000 Received: by wmec201 with SMTP id c201so191319484wme.0 for ; Mon, 16 Nov 2015 10:32:51 -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=MkbBpFVR+tZwhufId54+tIQOkejNmrYUvcpWWrVu2II=; b=JPXQ67SEM2KPp9Hbs5c8VCVAr1s/wMefQ/ibUxiWSq6xoIxyWe2ZaBe68iqejfBxU1 2IY2XF0XzJnu9P/aDNB5Kaw5V3DewSjojgb0U+m/KkwGNAL0D5UVEkPA5yRVw5Uw9yFI TeAAL01UEyqPscQzp/ofhSCJsyq84nixd2kwv35R9oNKnLhDE8+PybcsByizCgJKJjK8 GI3Qml36TQuS8IZUPuJs3/1Q1stW4YHv8RHfTbKhCUGlyeVICtgiaC7b6ppCMpSqXura DxZ/AycldpQta10cg7w14CptOY8BPW0xBG5njtALu492WSsmQ/A6eS1l4A3VuVY1qoh3 JSgw== 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=MkbBpFVR+tZwhufId54+tIQOkejNmrYUvcpWWrVu2II=; b=BAQDeI3HqDuAeVYJnWp/4ow1/i2YRnfsdsV5RS+RGFlvIcfzSkVIYdn+nbyz1X3JgT jJcKkJ647VBEd/kXrq66vlFS6c9GOpoQjpHxPnFERmyOx+wxbS02WNobW1e7VDZuWQos O3QnazqEDvh2jlU19GsA3rAZxth6Xd2Nk2yl3UH/i7bmvnng65B2DbHRHOtTtO5BiyJ+ wLraeqeG/ALEU35ZcOlZb7fb/Obh42MnKPAj4l///cIwc23mIVFQNlUlDmFCJuzb1hh3 e3IC6AmlWWOyyeQ1YtaiVWWyXkB3pAWwTNjv86Je+DdHEvimEfYWmbn0AU3p6VEVVmBj /80w== X-Gm-Message-State: ALoCoQn+J0cj90ireqM53O/+T38hdggbJ4OWtadmCl32Tbh3vC8VCDt6aV8Z5cxSfE2bmbqj6C21 X-Received: by 10.28.217.6 with SMTP id q6mr22194691wmg.5.1447698770485; Mon, 16 Nov 2015 10:32:50 -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.32.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Nov 2015 10:32:49 -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 02/12] arm64: only consider memblocks with NOMAP cleared for linear mapping Date: Mon, 16 Nov 2015 19:32:27 +0100 Message-Id: <1447698757-8762-3-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_103312_959612_9F04F726 X-CRM114-Status: GOOD ( 12.40 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -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/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 e3f563c81c48..0cf325c8dc55 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) { /*