From patchwork Wed Feb 19 17:19:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 206555 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=-10.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, 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 67E6BC34047 for ; Wed, 19 Feb 2020 17:19:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3ED2F20801 for ; Wed, 19 Feb 2020 17:19:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582132778; bh=Dv6uyXEmok6oEm/3BWepdoT4N6mQZdpZSQD3O1qUVIo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=GdQEYfpIJ+gcEklypjhron16xmMHHGlWHcS6kbGsWUYkWozFL+mCN/mNTqEW4dPdP Rd+1W22El5TC8kkDbR68i4XpBHLXmxuMFXAj1WZIEzWrn9YXRtDj00+8jU8xyEKCtH /aIy8erfmbbmyQCp2AxIc1RoRBh48mDSHR4np9ro= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726680AbgBSRTi (ORCPT ); Wed, 19 Feb 2020 12:19:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:42956 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726514AbgBSRTh (ORCPT ); Wed, 19 Feb 2020 12:19:37 -0500 Received: from cam-smtp0.cambridge.arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EC31224673; Wed, 19 Feb 2020 17:19:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582132777; bh=Dv6uyXEmok6oEm/3BWepdoT4N6mQZdpZSQD3O1qUVIo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bC5UK0Y3shDZN1aqGCmw33zkOpZM6lHRZK4rtNSrUciY75fFjiUH9lPHbI8bXCTc2 KD5LiiBGHxRIB8gUbYlYC4gSjzH6eSUNQ5w7DQ04xE2Q2lMY2FbAB/g/BI90GpMlGx NY++pUSDA3lCr47AHhxm8nCQeofMfolJdkooB84o= From: Ard Biesheuvel To: linux-efi@vger.kernel.org Cc: Ard Biesheuvel , Leif Lindholm , Peter Jones , Alexander Graf , Heinrich Schuchardt , Jeff Brasen , Atish Patra , x86@kernel.org Subject: [PATCH 2/9] efi: add support for EFI_RT_PROPERTIES table Date: Wed, 19 Feb 2020 18:19:00 +0100 Message-Id: <20200219171907.11894-3-ardb@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200219171907.11894-1-ardb@kernel.org> References: <20200219171907.11894-1-ardb@kernel.org> Sender: linux-efi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org Take the newly introduced EFI_RT_PROPERTIES_TABLE configuration table into account, which carries a mask of which EFI runtime services are still functional after ExitBootServices() has been called by the OS. Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/efi.c | 12 ++++++++++++ include/linux/efi.h | 9 +++++++++ 2 files changed, 21 insertions(+) diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c index 703a019d81b4..a35230517f9c 100644 --- a/drivers/firmware/efi/efi.c +++ b/drivers/firmware/efi/efi.c @@ -47,6 +47,7 @@ EXPORT_SYMBOL(efi); static unsigned long __ro_after_init rng_seed = EFI_INVALID_TABLE_ADDR; static unsigned long __initdata mem_reserve = EFI_INVALID_TABLE_ADDR; +static unsigned long __initdata rt_prop = EFI_INVALID_TABLE_ADDR; struct mm_struct efi_mm = { .mm_rb = RB_ROOT, @@ -449,6 +450,7 @@ static const efi_config_table_type_t common_tables[] __initconst = { {LINUX_EFI_TPM_EVENT_LOG_GUID, "TPMEventLog", &efi.tpm_log}, {LINUX_EFI_TPM_FINAL_LOG_GUID, "TPMFinalLog", &efi.tpm_final_log}, {LINUX_EFI_MEMRESERVE_TABLE_GUID, "MEMRESERVE", &mem_reserve}, + {EFI_RT_PROPERTIES_TABLE_GUID, "RTPROP", &rt_prop}, #ifdef CONFIG_EFI_RCI2_TABLE {DELLEMC_EFI_RCI2_TABLE_GUID, NULL, &rci2_table_phys}, #endif @@ -575,6 +577,16 @@ int __init efi_config_parse_tables(const efi_config_table_t *config_tables, } } + if (rt_prop != EFI_INVALID_TABLE_ADDR) { + efi_rt_properties_table_t *tbl; + + tbl = early_memremap(rt_prop, sizeof(*tbl)); + if (tbl) { + efi.runtime_supported_mask &= tbl->runtime_services_supported; + early_memunmap(tbl, sizeof(*tbl)); + } + } + return 0; } diff --git a/include/linux/efi.h b/include/linux/efi.h index 57695f400044..2ab33d5d6ca5 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h @@ -334,6 +334,7 @@ void efi_native_runtime_setup(void); #define EFI_TCG2_PROTOCOL_GUID EFI_GUID(0x607f766c, 0x7455, 0x42be, 0x93, 0x0b, 0xe4, 0xd7, 0x6d, 0xb2, 0x72, 0x0f) #define EFI_LOAD_FILE_PROTOCOL_GUID EFI_GUID(0x56ec3091, 0x954c, 0x11d2, 0x8e, 0x3f, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b) #define EFI_LOAD_FILE2_PROTOCOL_GUID EFI_GUID(0x4006c0c1, 0xfcb3, 0x403e, 0x99, 0x6d, 0x4a, 0x6c, 0x87, 0x24, 0xe0, 0x6d) +#define EFI_RT_PROPERTIES_TABLE_GUID EFI_GUID(0xeb66918a, 0x7eef, 0x402a, 0x84, 0x2e, 0x93, 0x1d, 0x21, 0xc3, 0x8a, 0xe9) #define EFI_IMAGE_SECURITY_DATABASE_GUID EFI_GUID(0xd719b2cb, 0x3d3a, 0x4596, 0xa3, 0xbc, 0xda, 0xd0, 0x0e, 0x67, 0x65, 0x6f) #define EFI_SHIM_LOCK_GUID EFI_GUID(0x605dab50, 0xe046, 0x4300, 0xab, 0xb6, 0x3d, 0xd8, 0x10, 0xdd, 0x8b, 0x23) @@ -486,6 +487,14 @@ typedef struct { #define EFI_PROPERTIES_TABLE_VERSION 0x00010000 #define EFI_PROPERTIES_RUNTIME_MEMORY_PROTECTION_NON_EXECUTABLE_PE_DATA 0x1 +typedef struct { + u16 version; + u16 length; + u32 runtime_services_supported; +} efi_rt_properties_table_t; + +#define EFI_RT_PROPERTIES_TABLE_VERSION 0x1 + #define EFI_INVALID_TABLE_ADDR (~0UL) typedef struct { From patchwork Wed Feb 19 17:19:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 206554 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=-10.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 B72A1C34056 for ; Wed, 19 Feb 2020 17:19:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 931522465D for ; Wed, 19 Feb 2020 17:19:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582132784; bh=3UF3ZqpkynaO6Ip8hQWd7SB5UbR3xruI+k9FQzuTYMw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=eRUYn5UcpVJ+pbCTt3dTClU3o0QaaR8Z42B/hjXkmMf4emrNW/oKIKu6KCiFRph0T Gfcy8rg7n+IFM+dmOIVJWIZeFvRXvisLQbRmQAcyup7K6PG8ANQUUVH+VtSwKC9UMk 8HwZlmxJ+N27EXKqYz955t8/o/9hjJ46eR96E+iw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726634AbgBSRTo (ORCPT ); Wed, 19 Feb 2020 12:19:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:43022 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726514AbgBSRTo (ORCPT ); Wed, 19 Feb 2020 12:19:44 -0500 Received: from cam-smtp0.cambridge.arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7D30B24672; Wed, 19 Feb 2020 17:19:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582132783; bh=3UF3ZqpkynaO6Ip8hQWd7SB5UbR3xruI+k9FQzuTYMw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KN1wiq1byoNz5SGoBc+33mTG4Unljvum+ji6UJaKIiC7LGC++s+l5fIRXaZnIPl3h gzq3QkARE/h8ebdi7P4u2RY9AZqG/x1jOWMPel/VYZI3o11GI/jYRZBiNLQAkpyFut Xg5qoGmq7aZIPqzQnMW2bZaTq2jRudtz9isCu23M= From: Ard Biesheuvel To: linux-efi@vger.kernel.org Cc: Ard Biesheuvel , Leif Lindholm , Peter Jones , Alexander Graf , Heinrich Schuchardt , Jeff Brasen , Atish Patra , x86@kernel.org, Alessandro Zummo , Alexandre Belloni , linux-rtc@vger.kernel.org Subject: [PATCH 4/9] efi: register EFI rtc platform device only when available Date: Wed, 19 Feb 2020 18:19:02 +0100 Message-Id: <20200219171907.11894-5-ardb@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200219171907.11894-1-ardb@kernel.org> References: <20200219171907.11894-1-ardb@kernel.org> Sender: linux-efi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org Drop the separate driver that registers the EFI rtc on all EFI systems that have runtime services available, and instead, move the registration into the core EFI code, and make it conditional on whether the actual time related services are available. Cc: Alessandro Zummo Cc: Alexandre Belloni Cc: linux-rtc@vger.kernel.org Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/efi.c | 3 ++ drivers/rtc/Makefile | 4 --- drivers/rtc/rtc-efi-platform.c | 35 -------------------- 3 files changed, 3 insertions(+), 39 deletions(-) diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c index abf4c02e0201..69a585106d30 100644 --- a/drivers/firmware/efi/efi.c +++ b/drivers/firmware/efi/efi.c @@ -321,6 +321,9 @@ static int __init efisubsys_init(void) } } + if (efi_rt_services_supported(EFI_RT_SUPPORTED_TIME_SERVICES)) + platform_device_register_simple("rtc-efi", 0, NULL, 0); + /* We register the efi directory at /sys/firmware/efi */ efi_kobj = kobject_create_and_add("efi", firmware_kobj); if (!efi_kobj) { diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile index 4ac8f19fb631..24c7dfa1bd7d 100644 --- a/drivers/rtc/Makefile +++ b/drivers/rtc/Makefile @@ -12,10 +12,6 @@ obj-$(CONFIG_RTC_CLASS) += rtc-core.o obj-$(CONFIG_RTC_MC146818_LIB) += rtc-mc146818-lib.o rtc-core-y := class.o interface.o -ifdef CONFIG_RTC_DRV_EFI -rtc-core-y += rtc-efi-platform.o -endif - rtc-core-$(CONFIG_RTC_NVMEM) += nvmem.o rtc-core-$(CONFIG_RTC_INTF_DEV) += dev.o rtc-core-$(CONFIG_RTC_INTF_PROC) += proc.o diff --git a/drivers/rtc/rtc-efi-platform.c b/drivers/rtc/rtc-efi-platform.c deleted file mode 100644 index 6c037dc4e3dc..000000000000 --- a/drivers/rtc/rtc-efi-platform.c +++ /dev/null @@ -1,35 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * Moved from arch/ia64/kernel/time.c - * - * Copyright (C) 1998-2003 Hewlett-Packard Co - * Stephane Eranian - * David Mosberger - * Copyright (C) 1999 Don Dugger - * Copyright (C) 1999-2000 VA Linux Systems - * Copyright (C) 1999-2000 Walt Drummond - */ - -#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - -#include -#include -#include -#include -#include - -static struct platform_device rtc_efi_dev = { - .name = "rtc-efi", - .id = -1, -}; - -static int __init rtc_init(void) -{ - if (efi_enabled(EFI_RUNTIME_SERVICES)) - if (platform_device_register(&rtc_efi_dev) < 0) - pr_err("unable to register rtc device...\n"); - - /* not necessarily an error */ - return 0; -} -module_init(rtc_init); From patchwork Wed Feb 19 17:19:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 206553 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=-10.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable 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 4C23AC34047 for ; Wed, 19 Feb 2020 17:19:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2427624671 for ; Wed, 19 Feb 2020 17:19:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582132791; bh=M4r2Ez8Ut7guqGx0FgNf2afCC29E2/mHpY61lj2zi2Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=cxkqOoRKeVFsbiW6Ok8LaNGoFGL/rN8SYmReaYiPcri/8WOXbJDOWrBqkJf+umekg kG53e0+cbwjh/5WID8uFdZvDJ+930qVinenRiml1lUPUm/a3okvYD+VhUvVuR/Qipg vKCnedC1FlzokIXZbF3V17Gm/dSt/Kkq9fdtH75c= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726681AbgBSRTu (ORCPT ); Wed, 19 Feb 2020 12:19:50 -0500 Received: from mail.kernel.org ([198.145.29.99]:43112 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726514AbgBSRTu (ORCPT ); Wed, 19 Feb 2020 12:19:50 -0500 Received: from cam-smtp0.cambridge.arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6E07C24656; Wed, 19 Feb 2020 17:19:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582132790; bh=M4r2Ez8Ut7guqGx0FgNf2afCC29E2/mHpY61lj2zi2Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EVh769Q66PKvWmXOtHZCOavCS6fMoGlEmkjIVgVApkiaV+6PYHCzRxvcMeTgyuMXz EExeUbAlJhdGRTL4ChntqilB1MEkdi5+5HKsC8N8pqXFQecOZOyL6x1E11HNrAjm53 aUS2ij0p8GYOW+IjChiiFHC3AgZzyIld2ZZniqM8= From: Ard Biesheuvel To: linux-efi@vger.kernel.org Cc: Ard Biesheuvel , Leif Lindholm , Peter Jones , Alexander Graf , Heinrich Schuchardt , Jeff Brasen , Atish Patra , x86@kernel.org, "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org Subject: [PATCH 6/9] scsi: iscsi: use EFI GetVariable only when available Date: Wed, 19 Feb 2020 18:19:04 +0100 Message-Id: <20200219171907.11894-7-ardb@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200219171907.11894-1-ardb@kernel.org> References: <20200219171907.11894-1-ardb@kernel.org> Sender: linux-efi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org Replace the EFI runtime services check with one that tells us whether EFI GetVariable() is implemented by the firmware. Cc: "James E.J. Bottomley" Cc: "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org Signed-off-by: Ard Biesheuvel --- drivers/scsi/isci/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/isci/init.c b/drivers/scsi/isci/init.c index b48aac8dfcb8..974c3b9116d5 100644 --- a/drivers/scsi/isci/init.c +++ b/drivers/scsi/isci/init.c @@ -621,7 +621,7 @@ static int isci_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) return -ENOMEM; pci_set_drvdata(pdev, pci_info); - if (efi_enabled(EFI_RUNTIME_SERVICES)) + if (efi_rt_services_supported(EFI_RT_SUPPORTED_GET_VARIABLE)) orom = isci_get_efi_var(pdev); if (!orom) From patchwork Wed Feb 19 17:19:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 206552 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=-10.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, 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 DD74BC34056 for ; Wed, 19 Feb 2020 17:19:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AC04A24656 for ; Wed, 19 Feb 2020 17:19:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582132797; bh=h+tuakNcgoRmbltb5wRmkwf67McBEmqsj9caQdfjLLg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=XLGbkn5tG2052hQ5xgpKUlS20oIh661Ef84XrY/bb/6MomhgUabpQIjrESrXcqyWU wGd7Uk/dVD7MGGxg848gEGGbgtKUl5Xkpt9V4g16X9MBALJ6ij8Fu0vQUZXewoKSiz 6FYxbeKWhf5uZ+FT41uakbpfsGlB1GpoiQ7syQTI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726734AbgBSRT5 (ORCPT ); Wed, 19 Feb 2020 12:19:57 -0500 Received: from mail.kernel.org ([198.145.29.99]:43242 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726707AbgBSRT4 (ORCPT ); Wed, 19 Feb 2020 12:19:56 -0500 Received: from cam-smtp0.cambridge.arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6941D24680; Wed, 19 Feb 2020 17:19:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582132795; bh=h+tuakNcgoRmbltb5wRmkwf67McBEmqsj9caQdfjLLg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OEYIGo7HMdb2atbEUkgTmvlk5AGebqyp10o7t+KNvNLe+pTSuPMGBwIOadFPWfXOm PRxfjwYsDhT1qWd++yX31ad+WDozEKoBVRtFpA4pPxGr35l0Vld9E/FMhCNxdHZh7k K3uscsaA/ECnu48wrWGnwLpo3wbgBQS2VMU36JcA= From: Ard Biesheuvel To: linux-efi@vger.kernel.org Cc: Ard Biesheuvel , Leif Lindholm , Peter Jones , Alexander Graf , Heinrich Schuchardt , Jeff Brasen , Atish Patra , x86@kernel.org Subject: [PATCH 8/9] x86/ima: use EFI GetVariable only when available Date: Wed, 19 Feb 2020 18:19:06 +0100 Message-Id: <20200219171907.11894-9-ardb@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200219171907.11894-1-ardb@kernel.org> References: <20200219171907.11894-1-ardb@kernel.org> Sender: linux-efi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org Replace the EFI runtime services check with one that tells us whether EFI GetVariable() is implemented by the firmware. Signed-off-by: Ard Biesheuvel --- arch/x86/kernel/ima_arch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/ima_arch.c b/arch/x86/kernel/ima_arch.c index 4d4f5d9faac3..cb6ed616a543 100644 --- a/arch/x86/kernel/ima_arch.c +++ b/arch/x86/kernel/ima_arch.c @@ -19,7 +19,7 @@ static enum efi_secureboot_mode get_sb_mode(void) size = sizeof(secboot); - if (!efi_enabled(EFI_RUNTIME_SERVICES)) { + if (!efi_rt_services_supported(EFI_RT_SUPPORTED_GET_VARIABLE)) { pr_info("ima: secureboot mode unknown, no efi\n"); return efi_secureboot_mode_unknown; }