All of lore.kernel.org
 help / color / mirror / Atom feed
* grub_efi_finish_boot_services not spec-compliant
@ 2013-02-24  4:35 Seth Goldberg
  2013-02-24  5:13 ` Andrey Borzenkov
  0 siblings, 1 reply; 3+ messages in thread
From: Seth Goldberg @ 2013-02-24  4:35 UTC (permalink / raw)
  To: The development of GNU GRUB

Hi there,

  On some systems, ExitBootServices() will fail due to a change in the memory map during execution of the boot services call.   The UEFI spec says that in that event, GetMemoryMap() should be repeated, then the new key passed to another call to ExitBootServices().  Note that the spec doesn't give an upper bound on the number of times to do this dance.  The logic in grub_efi_finish_boot_services() just tries once, leading to a failure to properly shut down boot services and various issue booting UEFI-compliant operating systems.

  --S

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: grub_efi_finish_boot_services not spec-compliant
  2013-02-24  4:35 grub_efi_finish_boot_services not spec-compliant Seth Goldberg
@ 2013-02-24  5:13 ` Andrey Borzenkov
  2013-02-24 23:46   ` Seth Goldberg
  0 siblings, 1 reply; 3+ messages in thread
From: Andrey Borzenkov @ 2013-02-24  5:13 UTC (permalink / raw)
  To: grub-devel

В Sat, 23 Feb 2013 20:35:17 -0800
Seth Goldberg <SETH.GOLDBERG@ORACLE.COM> пишет:

> Hi there,
> 
>   On some systems, ExitBootServices() will fail due to a change in the memory map during execution of the boot services call.   The UEFI spec says that in that event, GetMemoryMap() should be repeated, then the new key passed to another call to ExitBootServices().  Note that the spec doesn't give an upper bound on the number of times to do this dance.  The logic in grub_efi_finish_boot_services() just tries once, leading to a failure to properly shut down boot services and various issue booting UEFI-compliant operating systems.
> 

I have seen reports about ELILO failing due to changed memory map too,
but ELILO does retry GetMemoryMap() and still fails
(https://bugzilla.novell.com/show_bug.cgi?id=800035). Did you test if
increasing number of attempts to get memory map fixes it in your case?
What hardware is it?


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: grub_efi_finish_boot_services not spec-compliant
  2013-02-24  5:13 ` Andrey Borzenkov
@ 2013-02-24 23:46   ` Seth Goldberg
  0 siblings, 0 replies; 3+ messages in thread
From: Seth Goldberg @ 2013-02-24 23:46 UTC (permalink / raw)
  To: The development of GNU GRUB



On Feb 23, 2013, at 9:13 PM, Andrey Borzenkov <arvidjaar@gmail.com> wrote:

> В Sat, 23 Feb 2013 20:35:17 -0800
> Seth Goldberg <SETH.GOLDBERG@ORACLE.COM> пишет:
> 
>> Hi there,
>> 
>>  On some systems, ExitBootServices() will fail due to a change in the memory map during execution of the boot services call.   The UEFI spec says that in that event, GetMemoryMap() should be repeated, then the new key passed to another call to ExitBootServices().  Note that the spec doesn't give an upper bound on the number of times to do this dance.  The logic in grub_efi_finish_boot_services() just tries once, leading to a failure to properly shut down boot services and various issue booting UEFI-compliant operating systems.
> 
> I have seen reports about ELILO failing due to changed memory map too,
> but ELILO does retry GetMemoryMap() and still fails
> (https://bugzilla.novell.com/show_bug.cgi?id=800035). Did you test if
> increasing number of attempts to get memory map fixes it in your case?
> What hardware is it?

  Actually, ELILO violates the UEFI spec by calling other UEFI APIs (like memory allocation APIs) after the failed call to ExitBootServices, which is probably why it fails on those systems that require the retry.  The spec explicitly states that ONLY GetMemoryMap is safe to call after a failed call to ExitBootServices.

In my case, it is necessary to repeat the GetMemoryMap / ExitBootServices pair an additional time for it to succeed.

  --S


> 
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-02-24 23:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-24  4:35 grub_efi_finish_boot_services not spec-compliant Seth Goldberg
2013-02-24  5:13 ` Andrey Borzenkov
2013-02-24 23:46   ` Seth Goldberg

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.