On 12/16/13 23:20, Felix Poludov wrote:
> I think there is a couple of issues with the current implementation of
> CoreExitBootServices:
> 
>  
> 
> 1 . According to ExitBootServices() description, events of type
> EVT_SIGNAL_EXIT_BOOT_SERVICES, must be signaled once even if
> ExitBootServices() is called multiple times.
> 
> Current implementation signals events more than once if
> ExitBootServices() is called more than once.
> 
>  
> 
> 2. Since CoreTerminateMemoryMap, which validates MapKey, is called prior
> to signaling exit-boot-services events, memory map changes introduced by
> the event handlers are not getting detected.
> 
> It means, there is a chance that OS loader will successfully transition
> to runtime with an outdated memory map.
> 
> Technically exit-boot-services callbacks are not supposed to alter
> memory map.
> 
> However, it is very difficult for a driver writer to predict if a
> particular UEFI API such as GetVariable or HandleProtocol would alter a
> memory map.
> 
> I believe CoreExitBootServices implementation should detect such memory
> map changes and report them back to OS loader by returning
> EFI_INVALID_PARAMETER(MapKey is incorrect).

Apparently, some UEFI implementations do this already, because eg. Linux
seems to handle this case.

http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=d3768d88

Laszlo


------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to