grub_efi_finish_boot_services not spec-compliant
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
В Sat, 23 Feb 2013 20:35:17 -0800
Seth Goldberg <[email protected]> пишет:
Quoted 4 lines
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 toExitBootServices(). Note that the spec doesn't give an upper bound on the number of times to do this dance. The logic ingrub_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?
Quoted 5 lines · Andrey Borzenkov
В Sat, 23 Feb 2013 20:35:17 -0800
Seth Goldberg <[email protected]> пишет:Quoted 2 lines
Hi there,
Quoted 7 lines
Quoted 1 line
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 toExitBootServices(). Note that the spec doesn't give an upper bound on the number of times to do this dance. The logic ingrub_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
Quoted 5 lines
_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel