From: Konrad Rzeszutek Wilk Subject: [PATCH v1 1/3] EFI/early: Add /noexit to inhibit calling ExitBootServices Date: Fri, 24 Apr 2015 16:47:18 -0400 Message-ID: <1429908440-13923-2-git-send-email-konrad.wilk@oracle.com> References: <1429908440-13923-1-git-send-email-konrad.wilk@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YlkVb-0005li-65 for xen-devel@lists.xenproject.org; Fri, 24 Apr 2015 20:47:35 +0000 Received: by qkx62 with SMTP id 62so37723086qkx.0 for ; Fri, 24 Apr 2015 13:47:32 -0700 (PDT) In-Reply-To: <1429908440-13923-1-git-send-email-konrad.wilk@oracle.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org, olaf@aepfle.de, andrew.cooper3@citrix.com, jbeulich@suse.com List-Id: xen-devel@lists.xenproject.org The '/noexit' 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 --- xen/common/efi/boot.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c index f5e179b..40f6334 100644 --- a/xen/common/efi/boot.c +++ b/xen/common/efi/boot.c @@ -706,7 +706,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) EFI_GRAPHICS_OUTPUT_PROTOCOL *gop = NULL; EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *mode_info; union string section = { NULL }, name; - bool_t base_video = 0, retry; + bool_t base_video = 0, retry, exit_boot_services = 1; char *option_str; bool_t use_cfg_file; @@ -753,6 +753,8 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) { if ( wstrcmp(ptr + 1, L"basevideo") == 0 ) base_video = 1; + else if ( wstrcmp(ptr + 1, L"noexit") == 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 ) @@ -762,6 +764,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) { PrintStr(L"Xen EFI Loader options:\r\n"); PrintStr(L"-basevideo retain current video mode\r\n"); + PrintStr(L"-noexit Do not call ExitBootServices\r\n"); PrintStr(L"-cfg= specify configuration file\r\n"); PrintStr(L"-help, -? display this help\r\n"); blexit(NULL); @@ -1071,7 +1074,10 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) efi_arch_pre_exit_boot(); - status = efi_bs->ExitBootServices(ImageHandle, map_key); + if ( exit_boot_services) + status = efi_bs->ExitBootServices(ImageHandle, map_key); + else + status = 0; if ( status != EFI_INVALID_PARAMETER || retry ) break; } -- 2.1.0