Re: [edk2] BdsDxe: about always regenerating a bunch of boot options

Subject: Re: [edk2] BdsDxe: about always regenerating a bunch of boot options

From: Sergey Isakov <isakov-sl@bk.ru>

To: edk2-devel@lists.sourceforge.net

Date: 2014-02-20 17:53:48

Hi Laszlo,
I think there may be a bug: Variable.c
Look
-------------------
NewLoadContext->ForceReconnect = (BOOLEAN) (NewLoadContext->Attributes & LOAD_OPTION_FORCE_RECONNECT);
-------------------
But LOAD_OPTION_FORCE_RECONNECT == 2 and BOOLEAN == UINT8 
so ForceReconnect will be 2. Then
--------------
*((UINT32 *) Ptr) = LOAD_OPTION_ACTIVE | (ForceReconnect << 1);
--------------
I am not sure it is a bug but I think it should be corrected as
-------------
NewLoadContext->ForceReconnect = (BOOLEAN) ((NewLoadContext->Attributes & LOAD_OPTION_FORCE_RECONNECT)?1:0);
-------------
Wishes,
Sergey

On 19.02.2014, at 19:10, Laszlo Ersek wrote:

The phenomenon described in

https://fedoraproject.org/wiki/Unified_Extensible_Firmware_Interface#You_have_failed_to_provide_all_existing_bootloader_entries_when_changing_the_boot_order

is what I witness under OVMF too (and have been, for a long time).

Apparently this should be a bug somewhere in
"IntelFrameworkModulePkg/Universal/BdsDxe", which we trigger very
heavily in OVMF, because OVMF always rewrites the BootOrder variable and
always drops at least some of the auto-generated options from it. (This
is done to serve the boot order specs on the qemu command line.)

I used to think this was some obscure problem related to OVMF that we
didn't find the time (or motivation) to track down. But Adam's paragraph
in the Fedora wiki article suggests that the bug is present in UEFI
firmwares shipping on real hardware, which to me implies the bug is in
IntelFrameworkModulePkg.

Thanks,
Laszlo

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel