Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2530203imu; Thu, 29 Nov 2018 06:28:33 -0800 (PST) X-Google-Smtp-Source: AFSGD/WvLAKIaOwhbnmD8CDAKC5yhhmF1bXVb48Hn2qsq3KgY1v0bnoppQ6JwSYrmcmdUMC1OIYX X-Received: by 2002:a17:902:d03:: with SMTP id 3-v6mr1728768plu.66.1543501713593; Thu, 29 Nov 2018 06:28:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543501713; cv=none; d=google.com; s=arc-20160816; b=W/si5vfjkT+Vtpvy1CAm4jwOXc2Q1uGxiYBJST/moFRFmHFLIHranJ6IN7iHfnh1J6 t+I3m36j90XlTR1fEP23f4PP45MGo+TZoGNj/qxrsGDnA9AEvvygYaiOdJmNTuJUnZAw 2YZpkSmre0ed332ctDbVHmFmTf3J7De8dxw4qHXYEXg9M9HpxizcAc2qaTO19PS28f3F cCrlVUtVcRJyKF/TJzC3bwVyT30vCYvyoRRRugBXAK7zfdM51UE+uXW6blZNTMw83FgP YcOFH1MO8SpBNAmIlwPUCm7N0U2uBm3qUAayg+gtCPe4HAmlhSMjNHJe4H2TF7G023+b VnLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=X+gdC0uiaS93uYzqp7lzvOoxPiOw0n/nIGQFaUKUUMM=; b=Vd0smGxFAx141amc+KXEDPWY2xzt8UdSxiV5Gq6DAOf8XjVJHh9hiRmx7p55ieuX1w a8TxEHt1g7Eo0/lC8XfYOXNbsoTw65yV5Xkj88JIb3fjYYCMoOYFiEvUpSEcu8cGM4I9 H8Qta5LO+A8ChXoPCHG2+KN3+fHz42gbuRIOUz1TsMHBvLx63kNe7g4GslJXUH4TkFt/ X1DyknRuJAWO8vM3z4byYCTTNbub/9MBqNm+ZahBFcGPZMx7f2mqyefuQcBwXljhe/5c +tLL7T2HQz62w9QH5p8hKxjiDxtRWBL/1bqFoY4vbJSKXXfxUzw9+FdALGgDEhvZlw5W 2OgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="2GCBRwM/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cb1si2612462plb.37.2018.11.29.06.28.18; Thu, 29 Nov 2018 06:28:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="2GCBRwM/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387404AbeK3BcE (ORCPT + 99 others); Thu, 29 Nov 2018 20:32:04 -0500 Received: from mail.kernel.org ([198.145.29.99]:59946 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387394AbeK3BcE (ORCPT ); Thu, 29 Nov 2018 20:32:04 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5052E2145D; Thu, 29 Nov 2018 14:26:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543501591; bh=hwYNAI5aCYGR9QTXMUnQZpgLMZ0kzx8AUAyhwQD7lig=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2GCBRwM/6p8Y03xeN798hVTS4ecRW/Jlr3Lm3mQkYlyejHMdNFdgLVPuP3hnYhoVq nIf+zgy4gyWu2Pv7YO+BTr9AYrARtrUoLwoewD3zexgjeTfK5+jJwyO6FdjKjT32a5 Evu1YQZOB3Pwg1FKNjrkaSAN6dPsL8wTcoA4OBgA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ard Biesheuvel , Linus Torvalds , Peter Zijlstra , Thomas Gleixner , linux-efi@vger.kernel.org, Ingo Molnar , Sasha Levin Subject: [PATCH 4.14 061/100] efi/arm: Revert deferred unmap of early memmap mapping Date: Thu, 29 Nov 2018 15:12:31 +0100 Message-Id: <20181129140104.314798959@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181129140058.768942700@linuxfoundation.org> References: <20181129140058.768942700@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 33412b8673135b18ea42beb7f5117ed0091798b6 ] Commit: 3ea86495aef2 ("efi/arm: preserve early mapping of UEFI memory map longer for BGRT") deferred the unmap of the early mapping of the UEFI memory map to accommodate the ACPI BGRT code, which looks up the memory type that backs the BGRT table to validate it against the requirements of the UEFI spec. Unfortunately, this causes problems on ARM, which does not permit early mappings to persist after paging_init() is called, resulting in a WARN() splat. Since we don't support the BGRT table on ARM anway, let's revert ARM to the old behaviour, which is to take down the early mapping at the end of efi_init(). Signed-off-by: Ard Biesheuvel Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-efi@vger.kernel.org Fixes: 3ea86495aef2 ("efi/arm: preserve early mapping of UEFI memory ...") Link: http://lkml.kernel.org/r/20181114175544.12860-3-ard.biesheuvel@linaro.org Signed-off-by: Ingo Molnar Signed-off-by: Sasha Levin --- drivers/firmware/efi/arm-init.c | 4 ++++ drivers/firmware/efi/arm-runtime.c | 2 +- drivers/firmware/efi/memmap.c | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/efi/arm-init.c b/drivers/firmware/efi/arm-init.c index a7c522eac640..312f9f32e168 100644 --- a/drivers/firmware/efi/arm-init.c +++ b/drivers/firmware/efi/arm-init.c @@ -265,6 +265,10 @@ void __init efi_init(void) (params.mmap & ~PAGE_MASK))); init_screen_info(); + + /* ARM does not permit early mappings to persist across paging_init() */ + if (IS_ENABLED(CONFIG_ARM)) + efi_memmap_unmap(); } static int __init register_gop_device(void) diff --git a/drivers/firmware/efi/arm-runtime.c b/drivers/firmware/efi/arm-runtime.c index 8995a48bd067..ad1530aff633 100644 --- a/drivers/firmware/efi/arm-runtime.c +++ b/drivers/firmware/efi/arm-runtime.c @@ -122,7 +122,7 @@ static int __init arm_enable_runtime_services(void) { u64 mapsize; - if (!efi_enabled(EFI_BOOT) || !efi_enabled(EFI_MEMMAP)) { + if (!efi_enabled(EFI_BOOT)) { pr_info("EFI services will not be available.\n"); return 0; } diff --git a/drivers/firmware/efi/memmap.c b/drivers/firmware/efi/memmap.c index 5fc70520e04c..1907db2b38d8 100644 --- a/drivers/firmware/efi/memmap.c +++ b/drivers/firmware/efi/memmap.c @@ -118,6 +118,9 @@ int __init efi_memmap_init_early(struct efi_memory_map_data *data) void __init efi_memmap_unmap(void) { + if (!efi_enabled(EFI_MEMMAP)) + return; + if (!efi.memmap.late) { unsigned long size; -- 2.17.1