forked from QubesOS/qubes-vmm-xen
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpatch-0001-EFI-early-Add-noexit-to-inhibit-calling-ExitBootServices.patch
77 lines (68 loc) · 3.2 KB
/
patch-0001-EFI-early-Add-noexit-to-inhibit-calling-ExitBootServices.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
Subject: [Xen-devel] [PATCH v1 1/3] EFI/early: Add /noexit to inhibit calling ExitBootServices
To: xen-devel@xxxxxxxxxxxxxxxxxxxx, olaf@xxxxxxxxx, andrew.cooper3@xxxxxxxxxx, jbeulich@xxxxxxxx
From: Konrad Rzeszutek Wilk <konrad@xxxxxxxxxx>
Date: Fri, 24 Apr 2015 16:47:18 -0400
Delivery-date: Fri, 24 Apr 2015 20:47:39 +0000
List-id: Xen developer discussion <xen-devel.lists.xen.org>
The '/noexitboot' parameter will inhibit Xen in calling ExitBootServices.
That helps with some platforms with GetNextVariableName which
cannot deal running in 1-1 mode and having BootSevices being disabled.
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Ported to Xen 4.7.0
Signed-off-by: Marcus of Wetware Labs <[email protected]>
---
xen/common/efi/boot.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
--- xen-4.7.0/xen/common/efi/boot.c 2016-07-20 16:19:13.337000000 +0300
+++ xen-4.7.0-new/xen/common/efi/boot.c 2016-07-20 16:18:51.621000000 +0300
@@ -856,7 +856,7 @@
efi_arch_video_init(gop, info_size, mode_info);
}
-static void __init efi_exit_boot(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
+static void __init efi_exit_boot(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable, bool_t exit_boot_services)
{
EFI_STATUS status;
UINTN info_size = 0, map_key;
@@ -884,8 +884,11 @@
efi_arch_pre_exit_boot();
- status = SystemTable->BootServices->ExitBootServices(ImageHandle,
+ if (exit_boot_services)
+ status = SystemTable->BootServices->ExitBootServices(ImageHandle,
map_key);
+ else
+ status = 0;
efi_bs = NULL;
if ( status != EFI_INVALID_PARAMETER || retry )
break;
@@ -931,7 +934,7 @@
EFI_SHIM_LOCK_PROTOCOL *shim_lock;
EFI_GRAPHICS_OUTPUT_PROTOCOL *gop = NULL;
union string section = { NULL }, name;
- bool_t base_video = 0;
+ bool_t base_video = 0, exit_boot_services = 1;
char *option_str;
bool_t use_cfg_file;
@@ -971,6 +974,8 @@
base_video = 1;
else if ( wstrcmp(ptr + 1, L"mapbs") == 0 )
map_bs = 1;
+ else if ( wstrcmp(ptr + 1, L"noexitboot") == 0 )
+ exit_boot_services = 0;
else if ( wstrncmp(ptr + 1, L"cfg=", 4) == 0 )
cfg_file_name = ptr + 5;
else if ( i + 1 < argc && wstrcmp(ptr + 1, L"cfg") == 0 )
@@ -981,6 +986,7 @@
PrintStr(L"Xen EFI Loader options:\r\n");
PrintStr(L"-basevideo retain current video mode\r\n");
PrintStr(L"-mapbs map EfiBootServices{Code,Data}\r\n");
+ PrintStr(L"-noexitboot Do not call ExitBootServices\r\n");
PrintStr(L"-cfg=<file> specify configuration file\r\n");
PrintStr(L"-help, -? display this help\r\n");
blexit(NULL);
@@ -1146,7 +1164,7 @@
if ( gop )
efi_set_gop_mode(gop, gop_mode);
- efi_exit_boot(ImageHandle, SystemTable);
+ efi_exit_boot(ImageHandle, SystemTable, exit_boot_services);
efi_arch_post_exit_boot();
for( ; ; ); /* not reached */