From patchwork Fri Feb 15 12:33:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 158514 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp654538jaa; Fri, 15 Feb 2019 04:35:20 -0800 (PST) X-Google-Smtp-Source: AHgI3IYr7WRHLHaee7M2+xRWL7BVmdeOwbEeoFJNdC85elm4fvECxcfVncfUTHGfZyckll/X4cEi X-Received: by 2002:a63:1143:: with SMTP id 3mr8984821pgr.447.1550234120907; Fri, 15 Feb 2019 04:35:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550234120; cv=none; d=google.com; s=arc-20160816; b=cP/eHldtqCyfvNs8tqLTWr1h0dZUXVxc8bWh5mmgj+BzmPx3NJ3UnQeAwQlVbvF1Qw 3VqNAMgHL+Zj0LutPgJDrS2V9zwr3Zg2wI0dHpQ0MaKrOtT7Q/Vcnc17AIDtnBMc0Ry1 X8/1208Eo4uP7Q0xd/3WlRivfT4iGwPIusHy92Y951pt+DIcqijJRh6NkjYDniSa8AUU na4HJ0QzradFjCOrfbnWkR4zb+HCctoSsdqzS5PsH14hjxPIiP8t0/2I7jxDCDJxLna4 iW7MCjkWWgLkn2WgEX1RlNXV+gp+5uECYfIUMtWIEaLmfu4SuBteb15wJsH9qKA/59qf T5uw== 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=MSWVPDeW6Y6e3BJiwHPZzYiuddTe78aLBSeVRNBTdIU=; b=dH4toHRguS9EtX/46cUN4aYop3fPImfGlrMZ3tW1O5sH3rYn/WP6KmTOF+VlKIZg5r x56GA6+o3fMlQGxVZB8pEGlp+6Wdo5kq6ZReBf0h74BAWK589I9+rQVC9ErLH9mTuZn5 Tb88ZTx9+DLFE0r7+wKtkUsHRrDnpk3KmP0hJXt+PPULstkch+rUPg75QT0Z97x4rSn4 Xm35Nm6EsvSUwaXqx79PQAHx+X308WNyJyV5oy4uJ0nuEFaS5Q9yqYIHjEDGcca3aVCJ 34D51gN2cxHn3Lvt1oESib2+r8H5uqAe/TtArNKEsJG9YIlUIuGsuekzKtF/X18PVQVf wuHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bXkaI2hD; 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; 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 w21si5549151ply.143.2019.02.15.04.35.20; Fri, 15 Feb 2019 04:35:20 -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=@linaro.org header.s=google header.b=bXkaI2hD; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394704AbfBOMfS (ORCPT + 31 others); Fri, 15 Feb 2019 07:35:18 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:52742 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393807AbfBOMfO (ORCPT ); Fri, 15 Feb 2019 07:35:14 -0500 Received: by mail-wm1-f67.google.com with SMTP id m1so9790839wml.2 for ; Fri, 15 Feb 2019 04:35:12 -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=MSWVPDeW6Y6e3BJiwHPZzYiuddTe78aLBSeVRNBTdIU=; b=bXkaI2hDvhnNO685cjXMTl9TOoxG4WUy+qHiluxj0OGFHJq+7rZipSimJ7jrNtSG9r Sl7PaCtHqWSF0uuHMb+zLktaPsApxMDuRiyTgRBPEQ2JQTlEMA6vyJ+tkUCJ/A5i10MM tM5bx4tfQmIav9aLtYitKhxHeHMAyLc+YMqLMZ6uBxZQhFLeKA0qTjt7zwlQ03EJo+S3 vNSAA7ND7GdHMBM9pwtxcrYAj6npI9roSiQfpZTDeN4gvOAWLlR08BRoZfsuX1uZZ0Ac 5lk21fnOa7cUT31Zf27u1xdYwmGHhbkcdo0CMxCZDOa7vvkMN9WtHXan07LC+jyo/QRu 9JKA== 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=MSWVPDeW6Y6e3BJiwHPZzYiuddTe78aLBSeVRNBTdIU=; b=L1CM3d59mY+YFH5rlZn4eaw/zoudjqfTZ1MdknQRIGJJBKsYR+fL+3Yy3RyJUefuHG cvHIbt/m75Nv20F8BhNStK9k5UdEKXwgNJKFztFI3isM1vnS0WhSmhmDkEWh0aCpMGvj uCvwUkW28zvCskfOcTV0RIBNhPecADHwYQjyY8D3sidd22ys8LDnfHpzFvDQmxdwjFcs 9hUw5j0eN5AxSPmpDLqdvFx+AhkVD+vxhbbQQ0vWABDSsceEWoGiYx7UIUGnA4oaYDte kkJ3jEeNVnnuYqGEEA+K4fZu8/A3tgqsXYKhANxCUK8VevQyyFJKunqQDrVrCdMpdquJ W2Pw== X-Gm-Message-State: AHQUAubiLKhBxJdpKliFpDjPZqo/Zmg2PW9e+lhLBhmI7XS8ZNKkMYk4 cXOXyiGslvqNWwKjghR3a/gIeg== X-Received: by 2002:a1c:7510:: with SMTP id o16mr6412702wmc.38.1550234112073; Fri, 15 Feb 2019 04:35:12 -0800 (PST) Received: from localhost.localdomain (laubervilliers-657-1-83-120.w92-154.abo.wanadoo.fr. [92.154.90.120]) by smtp.gmail.com with ESMTPSA id y13sm636673wrw.31.2019.02.15.04.35.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Feb 2019 04:35:10 -0800 (PST) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, Ingo Molnar , Thomas Gleixner Cc: Ard Biesheuvel , linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, Marc Zyngier , Mike Rapoport , Will Deacon Subject: [PATCH 2/2] efi/arm: Revert "Defer persistent reservations until after paging_init()" Date: Fri, 15 Feb 2019 13:33:33 +0100 Message-Id: <20190215123333.21209-3-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190215123333.21209-1-ard.biesheuvel@linaro.org> References: <20190215123333.21209-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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. Acked-by: Will Deacon 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);