0f09adf
From: Josh Boyer <jwboyer@fedoraproject.org>
0f09adf
Date: Tue, 27 Aug 2013 13:33:03 -0400
0f09adf
Subject: [PATCH] efi: Add EFI_SECURE_BOOT bit
0f09adf
0f09adf
UEFI machines can be booted in Secure Boot mode.  Add a EFI_SECURE_BOOT bit
0f09adf
for use with efi_enabled.
0f09adf
0f09adf
Signed-off-by: Josh Boyer <jwboyer@fedoraproject.org>
0f09adf
---
0f09adf
 arch/x86/kernel/setup.c | 2 ++
0f09adf
 include/linux/efi.h     | 1 +
0f09adf
 2 files changed, 3 insertions(+)
0f09adf
0f09adf
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
0f09adf
index 5a5cf7395724..fb282ff6a802 100644
0f09adf
--- a/arch/x86/kernel/setup.c
0f09adf
+++ b/arch/x86/kernel/setup.c
0f09adf
@@ -1144,7 +1144,9 @@ void __init setup_arch(char **cmdline_p)
0f09adf
 
0f09adf
 #ifdef CONFIG_EFI_SECURE_BOOT_SIG_ENFORCE
0f09adf
 	if (boot_params.secure_boot) {
0f09adf
+		set_bit(EFI_SECURE_BOOT, &efi.flags);
0f09adf
 		enforce_signed_modules();
0f09adf
+		pr_info("Secure boot enabled\n");
0f09adf
 	}
0f09adf
 #endif
0f09adf
 
0f09adf
diff --git a/include/linux/efi.h b/include/linux/efi.h
0f09adf
index 45cb4ffdea62..ebe6a24cc1e1 100644
0f09adf
--- a/include/linux/efi.h
0f09adf
+++ b/include/linux/efi.h
0f09adf
@@ -923,6 +923,7 @@ extern int __init efi_setup_pcdp_console(char *);
0f09adf
 #define EFI_64BIT		5	/* Is the firmware 64-bit? */
0f09adf
 #define EFI_PARAVIRT		6	/* Access is via a paravirt interface */
0f09adf
 #define EFI_ARCH_1		7	/* First arch-specific bit */
0f09adf
+#define EFI_SECURE_BOOT		8	/* Are we in Secure Boot mode? */
0f09adf
 
0f09adf
 #ifdef CONFIG_EFI
0f09adf
 /*
0f09adf
-- 
0f09adf
1.9.3
0f09adf