summaryrefslogtreecommitdiffstats
path: root/patches/boot_time_opt_guest/0051-x86-reboot-Avoid-EFI-reboot-when-not-running-on-EFI.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/boot_time_opt_guest/0051-x86-reboot-Avoid-EFI-reboot-when-not-running-on-EFI.patch')
-rw-r--r--patches/boot_time_opt_guest/0051-x86-reboot-Avoid-EFI-reboot-when-not-running-on-EFI.patch38
1 files changed, 38 insertions, 0 deletions
diff --git a/patches/boot_time_opt_guest/0051-x86-reboot-Avoid-EFI-reboot-when-not-running-on-EFI.patch b/patches/boot_time_opt_guest/0051-x86-reboot-Avoid-EFI-reboot-when-not-running-on-EFI.patch
new file mode 100644
index 0000000..7cabf08
--- /dev/null
+++ b/patches/boot_time_opt_guest/0051-x86-reboot-Avoid-EFI-reboot-when-not-running-on-EFI.patch
@@ -0,0 +1,38 @@
1From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2From: Rob Bradford <robert.bradford@intel.com>
3Date: Thu, 29 Aug 2019 11:11:18 +0100
4Subject: [PATCH] x86/reboot: Avoid EFI reboot when not running on EFI
5
6Replace the check using efi_runtime_disabled() which only checks if EFI
7runtime was disabled on the kernel command line with a call to
8efi_enabled(EFI_RUNTIME_SERVICES) to check if EFI runtime services are
9available.
10
11In the situation where the kernel was booted without an EFI environment
12then only efi_enabled(EFI_RUNTIME_SERVICES) correctly represents that no
13EFI is available. Setting "noefi" or "efi=noruntime" on the commandline
14continue to have the same effect as efi_enabled(EFI_RUNTIME_SERVICES)
15will return false.
16
17Signed-off-by: Rob Bradford <robert.bradford@intel.com>
18Link: https://lore.kernel.org/lkml/20190829101119.7345-1-robert.bradford@intel.com
19---
20 arch/x86/kernel/reboot.c | 2 +-
21 1 file changed, 1 insertion(+), 1 deletion(-)
22
23diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
24index a515e2d230b7..7bf48675d9fc 100644
25--- a/arch/x86/kernel/reboot.c
26+++ b/arch/x86/kernel/reboot.c
27@@ -508,7 +508,7 @@ static int __init reboot_init(void)
28 */
29 rv = dmi_check_system(reboot_dmi_table);
30
31- if (!rv && efi_reboot_required() && !efi_runtime_disabled())
32+ if (!rv && efi_reboot_required() && efi_enabled(EFI_RUNTIME_SERVICES))
33 reboot_type = BOOT_EFI;
34
35 return 0;
36--
37https://clearlinux.org
38