mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] x86/reboot: Avoid EFI reboot when not running on EFI
@ 2019-08-29 10:11 Rob Bradford
  2019-08-29 12:18 ` Thomas Gleixner
  0 siblings, 1 reply; 5+ messages in thread
From: Rob Bradford @ 2019-08-29 10:11 UTC (permalink / raw)
  To: x86
  Cc: Rob Bradford, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	H. Peter Anvin, Rik van Riel, Juergen Gross, Jian-Hong Pan,
	linux-kernel

Replace the check using efi_runtime_disabled() which only checks if EFI
runtime was disabled on the kernel command line with a call to
efi_enabled(EFI_RUNTIME_SERVICES) to check if EFI runtime services are
available.

In the situation where the kernel was booted without an EFI environment
then only efi_enabled(EFI_RUNTIME_SERVICES) correctly represents that no
EFI is available. Setting "noefi" or "efi=noruntime" on the commandline
continue to have the same effect as efi_enabled(EFI_RUNTIME_SERVICES)
will return false.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
---
 arch/x86/kernel/reboot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
index 09d6bded3c1e..0b0a7fccdb00 100644
--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -500,7 +500,7 @@ static int __init reboot_init(void)
 	 */
 	rv = dmi_check_system(reboot_dmi_table);
 
-	if (!rv && efi_reboot_required() && !efi_runtime_disabled())
+	if (!rv && efi_reboot_required() && efi_enabled(EFI_RUNTIME_SERVICES))
 		reboot_type = BOOT_EFI;
 
 	return 0;
-- 
2.21.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-09-13 18:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-29 10:11 [PATCH] x86/reboot: Avoid EFI reboot when not running on EFI Rob Bradford
2019-08-29 12:18 ` Thomas Gleixner
2019-08-29 14:34   ` Bradford, Robert
2019-09-12 12:40     ` Bradford, Robert
2019-09-13 18:54     ` Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®