From patchwork Wed Apr 20 15:20:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 66215 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp2512128qge; Wed, 20 Apr 2016 08:22:18 -0700 (PDT) X-Received: by 10.66.246.228 with SMTP id xz4mr12954748pac.139.1461165738372; Wed, 20 Apr 2016 08:22:18 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id e19si16905594pfb.36.2016.04.20.08.22.18 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Apr 2016 08:22:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for 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; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for 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; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org 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 1astw9-0000Tg-OX; Wed, 20 Apr 2016 15:21:05 +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 1astw6-0000Qv-0p for linux-arm-kernel@lists.infradead.org; Wed, 20 Apr 2016 15:21:02 +0000 Received: by mail-wm0-x229.google.com with SMTP id n3so87725022wmn.0 for ; Wed, 20 Apr 2016 08:20:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=QN5QdD3s30hDhyZuRRTScK2Ch0dBpdbqhvV/ZoS1/QM=; b=aG0Uq6XLnvYMHxXrpenmF9bdTmPJcw5KDiRA6Rnj/U3tVWhjTMtFvd+1bji7nZ2MRg 3jPq6hx6OEavOLr0ZGibmHuy0R4+OykwKkk/ISSxEcr9fFyqp00QsTwAchgX4UxgTClb PJcaQ1WUSRQD5jObxpdjPqTufgnsbEMrVbgQc= 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; bh=QN5QdD3s30hDhyZuRRTScK2Ch0dBpdbqhvV/ZoS1/QM=; b=DWq+BNj7841SnoTGCZoQ1p9fDMGSB1ddmiYGTzRUi8fsliS2rSKn7rhCoPTDRq15Cc auoq8WR5q6fS7IGxJaoPJpNu0iAiuUkdMcDTxPt/BmK5bZKy7YwgxwP+FWab1LjdpS6N bsj42t8xyvucS2R1LFKarWfaXGp050arLNsCzXgqmrO61VyHphr3nBozX2RElt9MeLht uwo6XMsbJW0NU3tgLCXIjONj5uConLWok0q1ZDMfJCyC+je4d+nlO2Grokmu1KXvY7tO ZUIERQKlhTJ0xb/puhEOetdhxVZOy6jhaDRdOQKo6lG5A1GhfjiQZKvnHmfOSRuAirhQ 3QlQ== X-Gm-Message-State: AOPr4FXnRuXCKVLL+qBLb5DHWx68TgB4bkI7dysPHcyNaERFcY1ckd+RAns3v+iojE8IplHx X-Received: by 10.28.172.133 with SMTP id v127mr32657447wme.1.1461165639933; Wed, 20 Apr 2016 08:20:39 -0700 (PDT) Received: from localhost.localdomain ([195.55.142.58]) by smtp.gmail.com with ESMTPSA id u192sm10153091wmd.11.2016.04.20.08.20.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 Apr 2016 08:20:39 -0700 (PDT) From: Ard Biesheuvel To: linux-efi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, matt@codeblueprint.co.uk, will.deacon@arm.com Subject: [PATCH] efi/arm-init: reserve rather than unmap the memory map for ARM as well Date: Wed, 20 Apr 2016 17:20:35 +0200 Message-Id: <1461165635-8041-1-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.5.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160420_082102_371279_945A2245 X-CRM114-Status: GOOD ( 15.69 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 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:229 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 -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 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: leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Now that ARM has a fully functional memremap() implementation, there is no longer a need to remove the UEFI memory map from the linear mapping in order to be able to create a permanent mapping for it using generic code. So remove the 'IS_ENABLED(CONFIG_ARM)' conditional we added in commit 7cc8cbcf82d1 ("efi/arm64: Don't apply MEMBLOCK_NOMAP to UEFI memory map mapping"), and revert to using memblock_reserve() for both ARM and arm64 Signed-off-by: Ard Biesheuvel --- This is the permanent fix I alluded to in the commit log for the patch mentioned above. Russell has pulled the memremap() patches so this is good to go for v4.7 Note that current efi-next already has a conflict with v4.6-rc4 (where that patch landed) which will get even worse with this on top, so it may make sense to rebase efi-next onto v4.6-rc4 before pulling this (but note that this patch depends on 'efi/arm*: Use memremap() to create the persistent memmap mapping', so please don't reorder them to maintain bisectability) drivers/firmware/efi/arm-init.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) -- 2.5.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/drivers/firmware/efi/arm-init.c b/drivers/firmware/efi/arm-init.c index 909d974d35d9..49a681182eef 100644 --- a/drivers/firmware/efi/arm-init.c +++ b/drivers/firmware/efi/arm-init.c @@ -209,18 +209,7 @@ void __init efi_init(void) efi_memattr_init(); early_memunmap(efi.memmap.map, params.mmap_size); - if (IS_ENABLED(CONFIG_ARM)) { - /* - * ARM currently does not allow ioremap_cache() to be called on - * memory regions that are covered by struct page. So remove the - * UEFI memory map from the linear mapping. - */ - memblock_mark_nomap(params.mmap & PAGE_MASK, - PAGE_ALIGN(params.mmap_size + - (params.mmap & ~PAGE_MASK))); - } else { - memblock_reserve(params.mmap & PAGE_MASK, - PAGE_ALIGN(params.mmap_size + - (params.mmap & ~PAGE_MASK))); - } + memblock_reserve(params.mmap & PAGE_MASK, + PAGE_ALIGN(params.mmap_size + + (params.mmap & ~PAGE_MASK))); }