From patchwork Wed Feb 13 13:27:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 158227 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp72344jaa; Wed, 13 Feb 2019 05:28:42 -0800 (PST) X-Google-Smtp-Source: AHgI3IZnWlXA6OMcKQjnY9IM4q+CiMWrsF/9fRTyh7B52A0MR+o8KX0T0DAydGnDt4NNwBaDHuUU X-Received: by 2002:a63:460a:: with SMTP id t10mr508534pga.284.1550064522515; Wed, 13 Feb 2019 05:28:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550064522; cv=none; d=google.com; s=arc-20160816; b=xqKmqjGxNvfyC1v1bLsoyxjxv/DUQTcPk5zLAf0Qbf5ujlCCy4IuzHVBsPjpANgXtc RXT/ZxZA5BcrokdglE555ygoeARX++sX2XOmOUtFeFNzsrIZXcn3n8syirc3RF+uM3n+ 2R9h8DS+A4Q48IJsGfuvRO5jXng0tJXxp+LlwYnW3JZI1Gc4nJka1UgZKhAi1xC68FYS 0kaIhZbqVEcjiCK8A42l7A3xj+3SB/VNd/jIFKchHlA8g10aKrKs+q2rFFxK5tJL/Q4I wq0F5uyHznDmrvtGhocrNA5vHi4NFXN+FqL2FabUIos7SUjENBkaJt88g18kbdR5h7Ec 88Uw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=SvFSLn76SFJDwEu/S0bVHnKlVxmVyL4jfmZ7pu7W45E=; b=zSU9FEI2hwyT5A36PTrVzaZPoUPeN1mQKimX3nJD5SUmhNJ3LKJyvM7txRhSvv2Y7x cEK9AoI2TYfGMx6uTyH5TLJ1YX9PXNgTTJEmqxDwR3g8UP2skKJ6Ktf9UBmzK5jdkoaP dSz4E23xXv9vob3D0iNWXzI5bZG8+GDROi66MNre3FHvBJDnCsg7saPTpfDwQoKp78/l 6iPnSa9YckO/KYdQUgN08yrErNE+oUeBV25jJ5rGsFV+hRLJzHO3Lpc9SkqvczmiELMu XBSOZ/h2lCS4GWHrZwXLQgIERgXtx9UOffhVREq6L2s0qQKKwpyOd/62IABccbkjSfnf odxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nYNHnr2Z; spf=pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-efi-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g10si16074205plq.371.2019.02.13.05.28.42; Wed, 13 Feb 2019 05:28:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-efi-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=@linaro.org header.s=google header.b=nYNHnr2Z; spf=pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-efi-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730035AbfBMN2l (ORCPT + 3 others); Wed, 13 Feb 2019 08:28:41 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:43870 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729862AbfBMN2k (ORCPT ); Wed, 13 Feb 2019 08:28:40 -0500 Received: by mail-wr1-f68.google.com with SMTP id r2so2461793wrv.10 for ; Wed, 13 Feb 2019 05:28:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SvFSLn76SFJDwEu/S0bVHnKlVxmVyL4jfmZ7pu7W45E=; b=nYNHnr2Zsxh+UaDXNN6yzU0ly6IkH762vDdfRfYhFGRyB9VVEUhGSKXoIhjVWQ29Bt l2yS5gAG5bivhvIuH0KftYXcDIWlzChYzt8+KrCFslMDBc9AieVDkLJ84502Gr6BKIUv 74QqC+GSpz2LRAsaf+0fS+l0UCI4NBnbriNKoblA6yN2j4sTfAZYqAxr7bkQ+Pc6a7z6 wc6XYmVEWEcK/Yo+ukBHyLnIlHl8bULoeyucuYm8aaN4NS4MdkhKx0wukq6yCP/kZcZL 2eZLLQzFUC3BFc9hN1aD2HD1GE2dpll2qP3LLEGP6wmqJfLJeYp5NXI0lhY5YG7sV3sb Wt7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SvFSLn76SFJDwEu/S0bVHnKlVxmVyL4jfmZ7pu7W45E=; b=H6NWB7UVwC5BLC7/qT5e+sEAEs8wc+FUSgRxOBCBKA0sfWsJCdMOnDC1TY2q2J+bWK tVij1/EU5otCxDYSV3y/Spt/EcBHnFueIcYtsTzUJgoSICeu47+8e5cxfyHklXsUdO82 eH12o5UuZvafeyojdLPVUz8QlF4YXNPHr4rYYbuTwvdzFxL+XPRHZxNbZiEI1H1S1IKJ pXFO/OGT0joE/uQvxnBSArpWjH+Oah+pMtjGAsda2Ij7rr8pgL7KsFu6JHRVf87jwxgh kpWUZ7x6EdS230CwOkwUPXOiKRrNzTTsxRYWhJO57lVe66zhYpz9x1qPJZkd75/Uksfy joRw== X-Gm-Message-State: AHQUAuZ6NIzZOp3pl9QLqqRK181i52PDHMrz/Mwi6P30L2bICgYf9Y5o V31rf8qc2Z3/s68FCiW8BKU6dh2laKI= X-Received: by 2002:adf:fa0d:: with SMTP id m13mr402593wrr.93.1550064518026; Wed, 13 Feb 2019 05:28:38 -0800 (PST) Received: from localhost.localdomain (aputeaux-684-1-27-200.w90-86.abo.wanadoo.fr. [90.86.252.200]) by smtp.gmail.com with ESMTPSA id x3sm22841195wrd.19.2019.02.13.05.28.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Feb 2019 05:28:37 -0800 (PST) From: Ard Biesheuvel To: linux-efi@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, Ard Biesheuvel , Catalin Marinas , Will Deacon , Andrew Morton , Marc Zyngier , James Morse , linux-mm@kvack.org Subject: [PATCH 2/2] efi/arm: Revert "Defer persistent reservations until after paging_init()" Date: Wed, 13 Feb 2019 14:27:38 +0100 Message-Id: <20190213132738.10294-3-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190213132738.10294-1-ard.biesheuvel@linaro.org> References: <20190213132738.10294-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Sender: linux-efi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org This reverts commit eff896288872d687d9662000ec9ae11b6d61766f, which deferred the processing of persistent memory reservations to a point where the memory may have already been allocated and overwritten, defeating the purpose. Signed-off-by: Ard Biesheuvel --- arch/arm64/kernel/setup.c | 1 - drivers/firmware/efi/efi.c | 4 ---- drivers/firmware/efi/libstub/arm-stub.c | 3 --- include/linux/efi.h | 7 ------- 4 files changed, 15 deletions(-) -- 2.20.1 diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index 4b0e1231625c..d09ec76f08cf 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c @@ -313,7 +313,6 @@ void __init setup_arch(char **cmdline_p) arm64_memblock_init(); paging_init(); - efi_apply_persistent_mem_reservations(); acpi_table_upgrade(); diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c index 4c46ff6f2242..55b77c576c42 100644 --- a/drivers/firmware/efi/efi.c +++ b/drivers/firmware/efi/efi.c @@ -592,11 +592,7 @@ int __init efi_config_parse_tables(void *config_tables, int count, int sz, early_memunmap(tbl, sizeof(*tbl)); } - return 0; -} -int __init efi_apply_persistent_mem_reservations(void) -{ if (efi.mem_reserve != EFI_INVALID_TABLE_ADDR) { unsigned long prsv = efi.mem_reserve; diff --git a/drivers/firmware/efi/libstub/arm-stub.c b/drivers/firmware/efi/libstub/arm-stub.c index eee42d5e25ee..c037c6c5d0b7 100644 --- a/drivers/firmware/efi/libstub/arm-stub.c +++ b/drivers/firmware/efi/libstub/arm-stub.c @@ -75,9 +75,6 @@ void install_memreserve_table(efi_system_table_t *sys_table_arg) efi_guid_t memreserve_table_guid = LINUX_EFI_MEMRESERVE_TABLE_GUID; efi_status_t status; - if (IS_ENABLED(CONFIG_ARM)) - return; - status = efi_call_early(allocate_pool, EFI_LOADER_DATA, sizeof(*rsv), (void **)&rsv); if (status != EFI_SUCCESS) { diff --git a/include/linux/efi.h b/include/linux/efi.h index 45ff763fba76..28604a8d0aa9 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h @@ -1198,8 +1198,6 @@ static inline bool efi_enabled(int feature) extern void efi_reboot(enum reboot_mode reboot_mode, const char *__unused); extern bool efi_is_table_address(unsigned long phys_addr); - -extern int efi_apply_persistent_mem_reservations(void); #else static inline bool efi_enabled(int feature) { @@ -1218,11 +1216,6 @@ static inline bool efi_is_table_address(unsigned long phys_addr) { return false; } - -static inline int efi_apply_persistent_mem_reservations(void) -{ - return 0; -} #endif extern int efi_status_to_err(efi_status_t status);