From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Ross Lagerwall <ross.lagerwall@citrix.com>, xen-devel@lists.xen.org
Cc: Jan Beulich <jbeulich@suse.com>
Subject: Re: [PATCH] efi: Reallocate memory map if ExitBootServices() fails
Date: Fri, 29 May 2015 10:10:04 +0100 [thread overview]
Message-ID: <55682CEC.6050609@citrix.com> (raw)
In-Reply-To: <1432885739-18099-1-git-send-email-ross.lagerwall@citrix.com>
On 29/05/15 08:48, Ross Lagerwall wrote:
> If calling ExitBootServices() fails, the memory map size may have
> increased, so determine the new size and reallocate the memory map
> before calling GetMemoryMap() again.
>
> This was seen on the following machine when using the iscsidxe UEFI
> driver. The machine would consistently fail the first call to
> ExitBootServices().
> System Information
> Manufacturer: Supermicro
> Product Name: X10SLE-F/HF
> BIOS Information
> Vendor: American Megatrends Inc.
> Version: 2.00
> Release Date: 04/24/2014
>
> Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> xen/common/efi/boot.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
> index ef8476c..078f9b8 100644
> --- a/xen/common/efi/boot.c
> +++ b/xen/common/efi/boot.c
> @@ -1053,14 +1053,14 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
> efi_arch_video_init(gop, info_size, mode_info);
> }
>
> - efi_bs->GetMemoryMap(&efi_memmap_size, NULL, &map_key,
> - &efi_mdesc_size, &mdesc_ver);
> - efi_memmap = efi_arch_allocate_mmap_buffer(&efi_memmap_size);
> - if ( !efi_memmap )
> - blexit(L"Unable to allocate memory for EFI memory map");
> -
> for ( retry = 0; ; retry = 1 )
> {
> + efi_bs->GetMemoryMap(&efi_memmap_size, NULL, &map_key,
> + &efi_mdesc_size, &mdesc_ver);
> + efi_memmap = efi_arch_allocate_mmap_buffer(&efi_memmap_size);
> + if ( !efi_memmap )
> + blexit(L"Unable to allocate memory for EFI memory map");
> +
> status = efi_bs->GetMemoryMap(&efi_memmap_size, efi_memmap, &map_key,
> &efi_mdesc_size, &mdesc_ver);
> if ( EFI_ERROR(status) )
next prev parent reply other threads:[~2015-05-29 9:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-29 7:48 [PATCH] efi: Reallocate memory map if ExitBootServices() fails Ross Lagerwall
2015-05-29 9:10 ` Andrew Cooper [this message]
2015-05-29 9:45 ` Jan Beulich
2015-05-29 9:57 ` Ross Lagerwall
2015-05-29 10:55 ` Jan Beulich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55682CEC.6050609@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=jbeulich@suse.com \
--cc=ross.lagerwall@citrix.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.