Skip to contentSkip to conversation

x86/efi: fix reboot_mode when EFI runtime services are disabled

PATCH New Stefan Assmann 2 participants 2 messages Jul 24, 2017 – Jul 25, 2017 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/efi: fix reboot_mode when EFI runtime services are disabled

When EFI runtime services are disabled, for example by the "noefi" kernel cmdline parameter, the reboot_type could still be set to BOOT_EFI causing reboot to fail.
Fix this by checking if EFI runtime services are disabled.

---
 arch/x86/kernel/reboot.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
arch/x86/kernel/reboot.c +3 -3
index 2544700a2a87..23f00770ef45 100644
@@ -469,12 +469,12 @@ static int __init reboot_init(void)
 
 	/*
 	 * The DMI quirks table takes precedence. If no quirks entry
-	 * matches and the ACPI Hardware Reduced bit is set, force EFI
-	 * reboot.
+	 * matches and the ACPI Hardware Reduced bit is set and EFI
+	 * runtime services have not been disabled, force EFI reboot.
 	 */
 	rv = dmi_check_system(reboot_dmi_table);
 
-	if (!rv && efi_reboot_required())
+	if (!rv && efi_reboot_required() && !efi_runtime_disabled())
 		reboot_type = BOOT_EFI;
 
 	return 0;
Signature · 1 line
2.13.3
#1 lore raw

[tip:x86/urgent] x86/efi: Fix reboot_mode when EFI runtime services are disabled

x86/efi: Fix reboot_mode when EFI runtime services are disabled
Commit-ID:  4ecf7191fdcc5686c1eb2b06d7f93ce29d636cf0
Gitweb:     http://git.kernel.org/tip/4ecf7191fdcc5686c1eb2b06d7f93ce29d636cf0
Author:     Stefan Assmann <[email protected]>
AuthorDate: Mon, 24 Jul 2017 14:22:48 +0200
Committer:  Ingo Molnar <[email protected]>
CommitDate: Tue, 25 Jul 2017 11:30:45 +0200

x86/efi: Fix reboot_mode when EFI runtime services are disabled

When EFI runtime services are disabled, for example by the "noefi" kernel cmdline parameter, the reboot_type could still be set to BOOT_EFI causing reboot to fail.

Fix this by checking if EFI runtime services are enabled.

Cc Linus Torvalds <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
[ Fixed 'not disabled' double negation. ]
---
 arch/x86/kernel/reboot.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
arch/x86/kernel/reboot.c +3 -3
index 67393fc..a56bf60 100644
@@ -471,12 +471,12 @@ static int __init reboot_init(void)
 
 	/*
 	 * The DMI quirks table takes precedence. If no quirks entry
-	 * matches and the ACPI Hardware Reduced bit is set, force EFI
-	 * reboot.
+	 * matches and the ACPI Hardware Reduced bit is set and EFI
+	 * runtime services are enabled, force EFI reboot.
 	 */
 	rv = dmi_check_system(reboot_dmi_table);
 
-	if (!rv && efi_reboot_required())
+	if (!rv && efi_reboot_required() && !efi_runtime_disabled())
 		reboot_type = BOOT_EFI;
 
 	return 0;