Skip to content

Commit

Permalink
x86/efi: Fix reboot_mode when EFI runtime services are disabled
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Stefan Assmann <sassmann@kpanic.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20170724122248.24006-1-sassmann@kpanic.de
[ Fixed 'not disabled' double negation. ]
Signed-off-by: Ingo Molnar <mingo@kernel.org>
  • Loading branch information
Stefan Assmann authored and Ingo Molnar committed Jul 25, 2017
1 parent 18d5e6c commit 4ecf719
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions arch/x86/kernel/reboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4ecf719

Please sign in to comment.