diff options
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.patch | 38 |
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 @@ | |||
1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
2 | From: Rob Bradford <robert.bradford@intel.com> | ||
3 | Date: Thu, 29 Aug 2019 11:11:18 +0100 | ||
4 | Subject: [PATCH] x86/reboot: Avoid EFI reboot when not running on EFI | ||
5 | |||
6 | Replace the check using efi_runtime_disabled() which only checks if EFI | ||
7 | runtime was disabled on the kernel command line with a call to | ||
8 | efi_enabled(EFI_RUNTIME_SERVICES) to check if EFI runtime services are | ||
9 | available. | ||
10 | |||
11 | In the situation where the kernel was booted without an EFI environment | ||
12 | then only efi_enabled(EFI_RUNTIME_SERVICES) correctly represents that no | ||
13 | EFI is available. Setting "noefi" or "efi=noruntime" on the commandline | ||
14 | continue to have the same effect as efi_enabled(EFI_RUNTIME_SERVICES) | ||
15 | will return false. | ||
16 | |||
17 | Signed-off-by: Rob Bradford <robert.bradford@intel.com> | ||
18 | Link: 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 | |||
23 | diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c | ||
24 | index 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 | -- | ||
37 | https://clearlinux.org | ||
38 | |||