From abcd09ce766a0db049075ffab46b130f9a9afda9 Mon Sep 17 00:00:00 2001 From: Josh Boyer Date: Tue, 27 Aug 2013 13:33:03 -0400 Subject: [PATCH] efi: Add EFI_SECURE_BOOT bit Orabug: 21539498 UEFI machines can be booted in Secure Boot mode. Add a EFI_SECURE_BOOT bit for use with efi_enabled. Signed-off-by: Josh Boyer Signed-off-by: Guangyu Sun Signed-off-by: Santosh Shilimkar --- arch/x86/kernel/setup.c | 2 ++ include/linux/efi.h | 1 + 2 files changed, 3 insertions(+) diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 673ba9c92bdb..97838c712a96 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -1159,7 +1159,9 @@ void __init setup_arch(char **cmdline_p) #ifdef CONFIG_EFI_SECURE_BOOT_SECURELEVEL if (boot_params.secure_boot) { + set_bit(EFI_SECURE_BOOT, &efi.flags); set_securelevel(1); + pr_info("Secure boot enabled\n"); } #endif diff --git a/include/linux/efi.h b/include/linux/efi.h index d2ca9263c1ff..03eed462480c 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h @@ -973,6 +973,7 @@ extern int __init efi_setup_pcdp_console(char *); #define EFI_PARAVIRT 6 /* Access is via a paravirt interface */ #define EFI_ARCH_1 7 /* First arch-specific bit */ #define EFI_DBG 8 /* Print additional debug info at runtime */ +#define EFI_SECURE_BOOT 9 /* Are we in Secure Boot mode? */ #ifdef CONFIG_EFI /* -- 2.50.1