From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 81A42C4360F for ; Tue, 19 Feb 2019 19:03:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 498EE2147C for ; Tue, 19 Feb 2019 19:03:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Z+LI1CEP" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725963AbfBSTDV (ORCPT ); Tue, 19 Feb 2019 14:03:21 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:32801 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726610AbfBSTDV (ORCPT ); Tue, 19 Feb 2019 14:03:21 -0500 Received: by mail-wr1-f68.google.com with SMTP id i12so23270829wrw.0 for ; Tue, 19 Feb 2019 11:03:20 -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=hHBuDxz65iJoIlQu4JTLeWcyTuxRlLgTcYQBnteqhXM=; b=Z+LI1CEPR6mPEP1uLhjKXVPPX5rCTBsk8UxnLOkS3o8e9d/v8qeCOCxp48LemoTyzW BlV8+Yn21T3eFGdXHRfKXV0NTjyax0F0oS4oKWQVdO1ePOXzrc5Jh9r4XcAs8y+f2+4R 0Gtiqy5xx5l1D8/6uHHvXWbqMewli1Nkdc6pupq5SVNDZ7dVMUM0RIRIpMWbXr1FwTD7 C+hDhGK05WMpCbAkJUOY0Df8nBBtabCwbYBGnJPdxe4uDzMUyrnhPnBKUNYotgfS0tfH gY++Ys1lksjJuwbI1+GDU6d0pT+fYxB2XMzOxYoXioKgYKfa+OSheMEl8+7Zt6R4c1vH bM6g== 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=hHBuDxz65iJoIlQu4JTLeWcyTuxRlLgTcYQBnteqhXM=; b=aNCQGzH4Z7KSJffupz7URVLgEfxDnhPWNLXGUNVGwhkVtlzZAzBeUtNGBxWmtfhq7m UVCM9bMBkmS6NjKjSTULidpL6731Q+4h86EYEaQVt4jCs27Nj7niQ7lZ8C2177wIdxAy fZthQVjwn44v+6fL/m8nrUfwoHC1d5LBvWCD1yBI9c0G37w4fyfmMiTvOmeqQIbasFmT nFEyF+YCn2cexwNmHd7rQCF6CietAQrh+gCdMnxwfPcg726Qnh9gDAinSQ97obWcwPEI 7vGIPlYyE92Y4qCsTuxBbTILX/8VMlWE3/yk45UjQ50SN5cup2BilHBSiLX+o4J/qjRY wM1A== X-Gm-Message-State: AHQUAuY/bCpRWI80X1kJtRYnEAtuMvIAwlK+aIGvVBH33hYqh97xwMhq hvSSCAtKk1jzv5jgFkVq2HkDn8xLe2Y= X-Google-Smtp-Source: AHgI3IYcwHW//Q3QSucJe6zoG9bRV2htfjZ9eIAjCpSl3WPuUfDrgWV6lJDSJKXMfIcTtotQPdD8DQ== X-Received: by 2002:adf:dfca:: with SMTP id q10mr22555868wrn.45.1550602999412; Tue, 19 Feb 2019 11:03:19 -0800 (PST) Received: from sudo.home ([2a01:cb1d:112:6f00:99c6:fb2:8598:fb86]) by smtp.gmail.com with ESMTPSA id f7sm14778334wru.3.2019.02.19.11.03.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Feb 2019 11:03:18 -0800 (PST) From: Ard Biesheuvel To: stable@vger.kernel.org Cc: Ard Biesheuvel Subject: [PATCH 2/2] efi/arm: Revert "Defer persistent reservations until after paging_init()" Date: Tue, 19 Feb 2019 20:03:13 +0100 Message-Id: <20190219190313.2477-3-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190219190313.2477-1-ard.biesheuvel@linaro.org> References: <20190219190313.2477-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org Commit 582a32e708823e5957fd73ccd78dc4a9e49d21ea upstream. 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 Acked-by: Will Deacon Cc: Linus Torvalds Cc: Marc Zyngier Cc: Mike Rapoport Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: linux-arm-kernel@lists.infradead.org Cc: linux-efi@vger.kernel.org Link: http://lkml.kernel.org/r/20190215123333.21209-3-ard.biesheuvel@linaro.org Signed-off-by: Ingo Molnar 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(-) diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index f4fc1e0544b7..953e316521fc 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 415849bab233..bde3822cf539 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 3d36142cf812..30ac0c975f8a 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 100ce4a4aff6..845174e113ce 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h @@ -1167,8 +1167,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) { @@ -1187,11 +1185,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); -- 2.20.1