From patchwork Mon Sep 14 15:55:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 53593 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by patches.linaro.org (Postfix) with ESMTPS id 17CC922B17 for ; Mon, 14 Sep 2015 15:57:27 +0000 (UTC) Received: by wisv5 with SMTP id v5sf43193499wis.0 for ; Mon, 14 Sep 2015 08:57:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:cc:mime-version :content-type:content-transfer-encoding:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list; bh=964Yh6Dr+uZGnLi9TppAKW5rfyo77fqG5Hj5jwZ1MBo=; b=K6HvGOrykZ93PTaisD2xv9UKUbqJ9/PlxHojdE1CVE2ENooZ8cEfwU2RihRKQbW3Cw RYSDGYdyWZXGLOdcc8W9fGXmPYU/LSSKJhBwyx3+33jPaHjDjECZ49DieJnP3K4gswKD p+OfMocxJPD8dZqNb1Bb/ND9y8OHQzxtgPDrZgT7LFaiS1hOXbvbHzsNjepX/qwfglm9 +mjL5wYtumr5ppTFV7llLoN9aamRysNOu1+uWfB0SzU0G0yJWIrjG81uAHuTfQ4dlk6r ttElO18eGwEeg0AoXRDZTtrTwdSVE4K+ZZFbNCvBhk4bSEsILG0NakwX510YtlzdZl3H gvcA== X-Gm-Message-State: ALoCoQlDp6ecEIB/zziewlGdZYUHnYJkCT0kJlKA48O3TadFqtQXAaIYX9mLT2GXx7nt90k/AVwZ X-Received: by 10.112.189.105 with SMTP id gh9mr3237047lbc.16.1442246246379; Mon, 14 Sep 2015 08:57:26 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.21.100 with SMTP id u4ls642525lae.51.gmail; Mon, 14 Sep 2015 08:57:26 -0700 (PDT) X-Received: by 10.112.141.233 with SMTP id rr9mr15165210lbb.62.1442246246218; Mon, 14 Sep 2015 08:57:26 -0700 (PDT) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id e2si10213760lbp.39.2015.09.14.08.57.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Sep 2015 08:57:26 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by lanb10 with SMTP id b10so89410651lan.3 for ; Mon, 14 Sep 2015 08:57:26 -0700 (PDT) X-Received: by 10.112.151.106 with SMTP id up10mr15233253lbb.106.1442246246075; Mon, 14 Sep 2015 08:57:26 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp1276779lbq; Mon, 14 Sep 2015 08:57:25 -0700 (PDT) X-Received: by 10.68.220.132 with SMTP id pw4mr35826633pbc.149.1442246245060; Mon, 14 Sep 2015 08:57:25 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id lp3si24335047pab.137.2015.09.14.08.57.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Sep 2015 08:57:25 -0700 (PDT) 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; 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 1ZbW70-0003Eu-T0; Mon, 14 Sep 2015 15:56:10 +0000 Received: from mail-wi0-f182.google.com ([209.85.212.182]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZbW6r-0002vu-9c for linux-arm-kernel@lists.infradead.org; Mon, 14 Sep 2015 15:56:01 +0000 Received: by wiclk2 with SMTP id lk2so147032401wic.0 for ; Mon, 14 Sep 2015 08:55:39 -0700 (PDT) X-Received: by 10.180.104.68 with SMTP id gc4mr27144210wib.78.1442246139732; Mon, 14 Sep 2015 08:55:39 -0700 (PDT) Received: from localhost.localdomain (AToulon-652-1-468-111.w86-211.abo.wanadoo.fr. [86.211.148.111]) by smtp.gmail.com with ESMTPSA id ry1sm16225999wjb.24.2015.09.14.08.55.38 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 14 Sep 2015 08:55:38 -0700 (PDT) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, catalin.marinas@arm.com, will.deacon@arm.com, leif.lindholm@linaro.org, mark.rutland@arm.com, msalter@redhat.com, akpm@linux-foundation.org Subject: [PATCH 2/3] arm64: only consider memblocks with NOMAP cleared for linear mapping Date: Mon, 14 Sep 2015 17:55:28 +0200 Message-Id: <1442246129-13930-3-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1442246129-13930-1-git-send-email-ard.biesheuvel@linaro.org> References: <1442246129-13930-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150914_085601_528628_DD0AF950 X-CRM114-Status: GOOD ( 13.17 ) 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 [209.85.212.182 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.212.182 listed in wl.mailspike.net] -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.0 RCVD_IN_MSPIKE_WL Mailspike good senders 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: Ard Biesheuvel MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ard.biesheuvel@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Take the new memblock attribute MEMBLOCK_NOMAP into account when deciding whether a certain region is or should 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(-) diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index f5c0680d17d9..48133235d9f5 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -119,7 +119,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 9211b8527f25..7067ae232bed 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -370,6 +370,8 @@ static void __init map_mem(void) if (start >= end) break; + if (memblock_is_nomap(reg)) + continue; #ifndef CONFIG_ARM64_64K_PAGES /*