From patchwork Thu Oct 29 13:40:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 55771 Delivered-To: patch@linaro.org Received: by 10.112.61.134 with SMTP id p6csp573287lbr; Thu, 29 Oct 2015 06:43:21 -0700 (PDT) X-Received: by 10.50.155.33 with SMTP id vt1mr3837065igb.92.1446126200980; Thu, 29 Oct 2015 06:43:20 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id v2si26460743igh.21.2015.10.29.06.43.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Oct 2015 06:43:20 -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; 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 1ZrnSq-0006xs-A6; Thu, 29 Oct 2015 13:42:00 +0000 Received: from mail-wi0-x235.google.com ([2a00:1450:400c:c05::235]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZrnSL-0006oe-FH for linux-arm-kernel@lists.infradead.org; Thu, 29 Oct 2015 13:41:31 +0000 Received: by wijp11 with SMTP id p11so287318667wij.0 for ; Thu, 29 Oct 2015 06:41:07 -0700 (PDT) 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=YbD6xtqh2Yev5g8C+LP1c6nLQ+MJPb+pwGv0AFgBA/o=; b=xT7NEyLAl15LGEkBwRqBJdmm5BWEZ7QSIw5/vM8MM9Rhj0c59i1JOtGWi8EVs/UHVC qj8L2C5X+vQnT17oNp/tOfyDs7khKKbe/o7KOTzGlcIM49hjZW2m1/tppIoGp3wWEwwK /QZJaMve2wp6z8Avd60TcwzilDNwnGIn52a6Fxg2KJy26jQYBTTbvhXzcgtsyPvuw5fO g5OJeKCjnDDRPEq7pVHgcmLUwo8I+bP7iQmjPwVqy57DPm7GD5jQOdEOa9j+1YrRTq6b HYhOeyq+q3An9J89IyX/HvHYDqN5e7miidwE0OD4Oh9JAACB1Wp7NAvJMScnxKwnvSgw syGg== 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=YbD6xtqh2Yev5g8C+LP1c6nLQ+MJPb+pwGv0AFgBA/o=; b=Dmz13TyRuSgc77X7JEbE0IM72vT8M7nKq5V/0mRfDKPsD51l7Z8dE//UIfBFkKw1lM c79UCW+Yv5gYKUX560sa/3dxzuqRdkJgSiT5GYMoP1zJ3/AM+jzP+ZqBzkm0CBByf2lg 95FtnGJSi/huivgrkZr5ib5KyY3MkA00CabW7Db4CGMG5a5xPCR1B7dfzB3uXW1bPzOw PhK4cFCzODHp3MNKHazPUu1lonGa1Mi3Mp7+dS+aOL153LZxE9xCYaXIw7IK3IXQjdWi arxDGa/jazUa6qJfIpUDvSWfhoSFY1sYwYTl1HyGVcJ50QHvy9BA+xFa1jwSXwXbWM47 WT1w== X-Gm-Message-State: ALoCoQkriXYoI9VhLseyjm5n/fZBnuoeSUSwTDoPgsBrdBLmi+pcdS2x3yx72hBlRvPyuj1m35tQ X-Received: by 10.194.79.9 with SMTP id f9mr2235783wjx.130.1446126066980; Thu, 29 Oct 2015 06:41:06 -0700 (PDT) Received: from jessie.localdomain ([85.119.43.29]) by smtp.gmail.com with ESMTPSA id p75sm3578918wmd.22.2015.10.29.06.41.05 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 29 Oct 2015 06:41:06 -0700 (PDT) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, leif.lindholm@linaro.org, mark.rutland@arm.com, will.deacon@arm.com Subject: [PATCH 1/3] arm64/efi: set EFI_MEMMAP bit only after mapping the memory map Date: Thu, 29 Oct 2015 14:40:57 +0100 Message-Id: <1446126059-25336-2-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1446126059-25336-1-git-send-email-ard.biesheuvel@linaro.org> References: <1446126059-25336-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151029_064129_708456_30EA0CED X-CRM114-Status: GOOD ( 13.04 ) 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:c05:0:0:0:235 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: matt@codeblueprint.co.uk, catalin.marinas@arm.com, Ard Biesheuvel MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org In an upcoming patch, we will wire up page_is_ram() to the UEFI memory map, so make sure the EFI_MEMMAP bit accurately reflects whether the UEFI memory map is available via its permanent mapping. Signed-off-by: Ard Biesheuvel --- arch/arm64/kernel/efi.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) -- 2.1.4 _______________________________________________ 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/kernel/efi.c b/arch/arm64/kernel/efi.c index 852eb927ea85..11b59e9a5954 100644 --- a/arch/arm64/kernel/efi.c +++ b/arch/arm64/kernel/efi.c @@ -191,8 +191,6 @@ static __init void reserve_regions(void) if (efi_enabled(EFI_DBG)) pr_cont("\n"); } - - set_bit(EFI_MEMMAP, &efi.flags); } void __init efi_init(void) @@ -291,13 +289,6 @@ static int __init arm64_enable_runtime_services(void) return -1; } - if (efi_runtime_disabled()) { - pr_info("EFI runtime services will be disabled.\n"); - return -1; - } - - pr_info("Remapping and enabling EFI services.\n"); - mapsize = memmap.map_end - memmap.map; memmap.map = (__force void *)ioremap_cache((phys_addr_t)memmap.phys_map, mapsize); @@ -307,6 +298,14 @@ static int __init arm64_enable_runtime_services(void) } memmap.map_end = memmap.map + mapsize; efi.memmap = &memmap; + set_bit(EFI_MEMMAP, &efi.flags); + + if (efi_runtime_disabled()) { + pr_info("EFI runtime services will be disabled.\n"); + return -1; + } + + pr_info("Remapping and enabling EFI services.\n"); efi.systab = (__force void *)ioremap_cache(efi_system_table, sizeof(efi_system_table_t));