From patchwork Sun Feb 23 08:34:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 11398717 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8B01F930 for ; Sun, 23 Feb 2020 08:37:20 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5123C206E0 for ; Sun, 23 Feb 2020 08:37:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=gmx.net header.i=@gmx.net header.b="PMMUlrTL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5123C206E0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=gmx.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j5mjs-0005OD-DE; Sun, 23 Feb 2020 08:35:48 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j5mjr-0005O8-E3 for xen-devel@lists.xenproject.org; Sun, 23 Feb 2020 08:35:47 +0000 X-Inumbo-ID: 7b531630-5617-11ea-aa99-bc764e2007e4 Received: from mout.gmx.net (unknown [212.227.17.22]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 7b531630-5617-11ea-aa99-bc764e2007e4; Sun, 23 Feb 2020 08:35:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1582446942; bh=WcANPpQWohym4JgU2Mv+t1Lv7qPTD9zB5cEjQZYcpPQ=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=PMMUlrTLnTNrUBECdxq8743qyOTcKm602yYZcwOUb2WMCJkokhp4AdtMCGnSVLjGZ ebi9zpKIsoNqFbcEJfpPqEberaCPLDNrhgaSC7zNPUBwUpThh9fMGaO/gV0Dn+js+Z DkzyUVnCnLN2gd7DkAEQdDrCLpxBxdoNnD1H4kBw= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from LT02.fritz.box ([84.119.33.160]) by mail.gmx.com (mrgmx104 [212.227.17.174]) with ESMTPSA (Nemesis) id 1N6KYb-1jUP6F1q4v-016foT; Sun, 23 Feb 2020 09:35:42 +0100 From: Heinrich Schuchardt To: Ard Biesheuvel Date: Sun, 23 Feb 2020 09:34:46 +0100 Message-Id: <20200223083446.15817-1-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:6MWGPGwUIoMd7vT38AP752PI5Diuuj8H5BlBxHIdF24mzVvdTTF pcGX7S1f75iNx1iI9jihjTQmwaPURiZ0uTQZAMZEZ+a03RNDlvhFrYidqRH8UsPHhgpGgkJ X6d8Ot7T3TbDhZfwtRRkqx8Eydv/271z35tKOIfG1Me73Jph/pz7R6mgdyuEp8HMUYHyqvQ AqPiiVVd7vSv5hGxssS+w== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:+QxYoQlLo94=:bkaK5hGQcHvyOJhGBFMr7Y W5p/zyj6XOW750/EpS8p7gpnciOoW/n+D5sMAZGEjWsn4LnirsQJa3RfaRwlPwDXRRjCtk34N 8fKbXy3TQZQ7YMvz3C7f5mnoL7vvwtdtw0KE71yI7YKey409oUjnjyGqMBQGfl5JX5YSDnb74 07CHfXwnKVp30WEEHHSCdl2nFsNf6VLDGoviqr+xVN34vUFDKyMQRrDZHH84uFPPPsyhe5JNv XwOU6Sb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mode labels X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , Stefano Stabellini , linux-efi@vger.kernel.org, Heinrich Schuchardt , x86@kernel.org, linux-kernel@vger.kernel.org, Ingo Molnar , Borislav Petkov , "H . Peter Anvin" , xen-devel@lists.xenproject.org, Boris Ostrovsky , Thomas Gleixner Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" According to the "Linux kernel coding style" labels in enums are capitalized. Signed-off-by: Heinrich Schuchardt --- The patch is applicable to the efi/next git branch. --- arch/x86/kernel/ima_arch.c | 14 +++++++------- arch/x86/kernel/setup.c | 4 ++-- arch/x86/xen/efi.c | 10 +++++----- drivers/firmware/efi/libstub/arm-stub.c | 2 +- drivers/firmware/efi/libstub/secureboot.c | 10 +++++----- drivers/firmware/efi/libstub/x86-stub.c | 2 +- include/linux/efi.h | 8 ++++---- 7 files changed, 25 insertions(+), 25 deletions(-) -- 2.25.0 diff --git a/arch/x86/kernel/ima_arch.c b/arch/x86/kernel/ima_arch.c index cb6ed616a543..4205baaae450 100644 --- a/arch/x86/kernel/ima_arch.c +++ b/arch/x86/kernel/ima_arch.c @@ -21,7 +21,7 @@ static enum efi_secureboot_mode get_sb_mode(void) if (!efi_rt_services_supported(EFI_RT_SUPPORTED_GET_VARIABLE)) { pr_info("ima: secureboot mode unknown, no efi\n"); - return efi_secureboot_mode_unknown; + return EFI_SECUREBOOT_MODE_UNKNOWN; } /* Get variable contents into buffer */ @@ -29,12 +29,12 @@ static enum efi_secureboot_mode get_sb_mode(void) NULL, &size, &secboot); if (status == EFI_NOT_FOUND) { pr_info("ima: secureboot mode disabled\n"); - return efi_secureboot_mode_disabled; + return EFI_SECUREBOOT_MODE_DISABLED; } if (status != EFI_SUCCESS) { pr_info("ima: secureboot mode unknown\n"); - return efi_secureboot_mode_unknown; + return EFI_SECUREBOOT_MODE_UNKNOWN; } size = sizeof(setupmode); @@ -46,11 +46,11 @@ static enum efi_secureboot_mode get_sb_mode(void) if (secboot == 0 || setupmode == 1) { pr_info("ima: secureboot mode disabled\n"); - return efi_secureboot_mode_disabled; + return EFI_SECUREBOOT_MODE_DISABLED; } pr_info("ima: secureboot mode enabled\n"); - return efi_secureboot_mode_enabled; + return EFI_SECUREBOOT_MODE_ENABLED; } bool arch_ima_get_secureboot(void) @@ -61,12 +61,12 @@ bool arch_ima_get_secureboot(void) if (!initialized && efi_enabled(EFI_BOOT)) { sb_mode = boot_params.secure_boot; - if (sb_mode == efi_secureboot_mode_unset) + if (sb_mode == EFI_SECUREBOOT_MODE_UNSET) sb_mode = get_sb_mode(); initialized = true; } - if (sb_mode == efi_secureboot_mode_enabled) + if (sb_mode == EFI_SECUREBOOT_MODE_ENABLED) return true; else return false; diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index a74262c71484..76a7b66ef0e6 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -1126,10 +1126,10 @@ void __init setup_arch(char **cmdline_p) if (efi_enabled(EFI_BOOT)) { switch (boot_params.secure_boot) { - case efi_secureboot_mode_disabled: + case EFI_SECUREBOOT_MODE_DISABLED: pr_info("Secure boot disabled\n"); break; - case efi_secureboot_mode_enabled: + case EFI_SECUREBOOT_MODE_ENABLED: pr_info("Secure boot enabled\n"); break; default: diff --git a/arch/x86/xen/efi.c b/arch/x86/xen/efi.c index 1abe455d926a..bb715e3c9474 100644 --- a/arch/x86/xen/efi.c +++ b/arch/x86/xen/efi.c @@ -110,7 +110,7 @@ static enum efi_secureboot_mode xen_efi_get_secureboot(void) NULL, &size, &secboot); if (status == EFI_NOT_FOUND) - return efi_secureboot_mode_disabled; + return EFI_SECUREBOOT_MODE_DISABLED; if (status != EFI_SUCCESS) goto out_efi_err; @@ -123,7 +123,7 @@ static enum efi_secureboot_mode xen_efi_get_secureboot(void) goto out_efi_err; if (secboot == 0 || setupmode == 1) - return efi_secureboot_mode_disabled; + return EFI_SECUREBOOT_MODE_DISABLED; /* See if a user has put the shim into insecure mode. */ size = sizeof(moksbstate); @@ -135,15 +135,15 @@ static enum efi_secureboot_mode xen_efi_get_secureboot(void) goto secure_boot_enabled; if (moksbstate == 1) - return efi_secureboot_mode_disabled; + return EFI_SECUREBOOT_MODE_DISABLED; secure_boot_enabled: pr_info("UEFI Secure Boot is enabled.\n"); - return efi_secureboot_mode_enabled; + return EFI_SECUREBOOT_MODE_ENABLED; out_efi_err: pr_err("Could not determine UEFI Secure Boot status.\n"); - return efi_secureboot_mode_unknown; + return EFI_SECUREBOOT_MODE_UNKNOWN; } void __init xen_efi_init(struct boot_params *boot_params) diff --git a/drivers/firmware/efi/libstub/arm-stub.c b/drivers/firmware/efi/libstub/arm-stub.c index 13559c7e6643..87a3bdca1e0a 100644 --- a/drivers/firmware/efi/libstub/arm-stub.c +++ b/drivers/firmware/efi/libstub/arm-stub.c @@ -244,7 +244,7 @@ efi_status_t efi_entry(efi_handle_t handle, efi_system_table_t *sys_table_arg) * boot is enabled if we can't determine its state. */ if (!IS_ENABLED(CONFIG_EFI_ARMSTUB_DTB_LOADER) || - secure_boot != efi_secureboot_mode_disabled) { + secure_boot != EFI_SECUREBOOT_MODE_DISABLED) { if (strstr(cmdline_ptr, "dtb=")) pr_efi("Ignoring DTB from command line.\n"); } else { diff --git a/drivers/firmware/efi/libstub/secureboot.c b/drivers/firmware/efi/libstub/secureboot.c index a765378ad18c..7fdbf9a87c3d 100644 --- a/drivers/firmware/efi/libstub/secureboot.c +++ b/drivers/firmware/efi/libstub/secureboot.c @@ -38,7 +38,7 @@ enum efi_secureboot_mode efi_get_secureboot(void) status = get_efi_var(efi_SecureBoot_name, &efi_variable_guid, NULL, &size, &secboot); if (status == EFI_NOT_FOUND) - return efi_secureboot_mode_disabled; + return EFI_SECUREBOOT_MODE_DISABLED; if (status != EFI_SUCCESS) goto out_efi_err; @@ -49,7 +49,7 @@ enum efi_secureboot_mode efi_get_secureboot(void) goto out_efi_err; if (secboot == 0 || setupmode == 1) - return efi_secureboot_mode_disabled; + return EFI_SECUREBOOT_MODE_DISABLED; /* * See if a user has put the shim into insecure mode. If so, and if the @@ -64,13 +64,13 @@ enum efi_secureboot_mode efi_get_secureboot(void) if (status != EFI_SUCCESS) goto secure_boot_enabled; if (!(attr & EFI_VARIABLE_RUNTIME_ACCESS) && moksbstate == 1) - return efi_secureboot_mode_disabled; + return EFI_SECUREBOOT_MODE_DISABLED; secure_boot_enabled: pr_efi("UEFI Secure Boot is enabled.\n"); - return efi_secureboot_mode_enabled; + return EFI_SECUREBOOT_MODE_ENABLED; out_efi_err: pr_efi_err("Could not determine UEFI Secure Boot status.\n"); - return efi_secureboot_mode_unknown; + return EFI_SECUREBOOT_MODE_UNKNOWN; } diff --git a/drivers/firmware/efi/libstub/x86-stub.c b/drivers/firmware/efi/libstub/x86-stub.c index 9db98839d7b4..f06bc07a2f75 100644 --- a/drivers/firmware/efi/libstub/x86-stub.c +++ b/drivers/firmware/efi/libstub/x86-stub.c @@ -777,7 +777,7 @@ struct boot_params *efi_main(efi_handle_t handle, * If the boot loader gave us a value for secure_boot then we use that, * otherwise we ask the BIOS. */ - if (boot_params->secure_boot == efi_secureboot_mode_unset) + if (boot_params->secure_boot == EFI_SECUREBOOT_MODE_UNSET) boot_params->secure_boot = efi_get_secureboot(); /* Ask the firmware to clear memory on unclean shutdown */ diff --git a/include/linux/efi.h b/include/linux/efi.h index 2ab33d5d6ca5..0d3cd3f61e73 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h @@ -1081,10 +1081,10 @@ extern void efi_call_virt_check_flags(unsigned long flags, const char *call); extern unsigned long efi_call_virt_save_flags(void); enum efi_secureboot_mode { - efi_secureboot_mode_unset, - efi_secureboot_mode_unknown, - efi_secureboot_mode_disabled, - efi_secureboot_mode_enabled, + EFI_SECUREBOOT_MODE_UNSET, + EFI_SECUREBOOT_MODE_UNKNOWN, + EFI_SECUREBOOT_MODE_DISABLED, + EFI_SECUREBOOT_MODE_ENABLED, }; enum efi_secureboot_mode efi_get_secureboot(void);