[edk2-devel] [PATCH v3 12/14] OvmfPkg/PlatformBootManagerLib: switch to QemuLoadImageLib

Laszlo Ersek lersek at redhat.com
Thu Mar 5 23:42:12 UTC 2020


On 03/05/20 22:20, Ard Biesheuvel wrote:
> On Thu, 5 Mar 2020 at 22:15, Laszlo Ersek <lersek at redhat.com> wrote:
>>
>> Hi Ard,
>>
>> On 03/05/20 14:46, Ard Biesheuvel wrote:
>>> Replace the open coded sequence to load Linux on x86 with a short and
>>> generic sequence invoking QemuLoadImageLib, which can be provided by
>>> a generic version that only supports the LoadImage and StartImage boot
>>> services, and one that incorporates the entire legacy loading sequence
>>> as well.
>>>
>>> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2566
>>> Signed-off-by: Ard Biesheuvel <ard.biesheuvel at linaro.org>
>>> Reviewed-by: Laszlo Ersek <lersek at redhat.com>
>>> ---
>>>  OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf |   2 +-
>>>  OvmfPkg/Library/PlatformBootManagerLib/QemuKernel.c               | 144 ++------------------
>>>  2 files changed, 14 insertions(+), 132 deletions(-)
>>>
>>> diff --git a/OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf b/OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
>>> index c479f113b92b..e470b9a6a3e5 100644
>>> --- a/OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
>>> +++ b/OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
>>> @@ -49,7 +49,7 @@ [LibraryClasses]
>>>    NvVarsFileLib
>>>    QemuFwCfgLib
>>>    QemuFwCfgS3Lib
>>> -  LoadLinuxLib
>>> +  QemuLoadImageLib
>>>    QemuBootOrderLib
>>>    ReportStatusCodeLib
>>>    UefiLib
>>
>> This hunk (in commit 859b55443a42) seems to break the OvmfXen platform build:
>>
>> Active Platform          = OvmfPkg/OvmfXen.dsc
>>
>> build.py...
>> OvmfPkg/OvmfXen.dsc(...): error 4000: Instance of library class [QemuLoadImageLib] is not found
>>         in [OvmfPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf] [X64]
>>         consumed by module [MdeModulePkg/Universal/BdsDxe/BdsDxe.inf]
>>
>> Can you please send a patch?
>>
>> I think resolving the lib class to the generic instance suffices. gBS->LoadImage() will return EFI_NOT_FOUND from QemuLoadKernelImage(), because OvmfPkg/QemuKernelLoaderFsDxe is not included in the Xen platform.
>>
>> An alternative fix that's larger in source code, but lighter in binary code, would be to add a Null instance of QemuLoadImageLib, and use that in the Xen platform.
>>
>> For the future, please include OvmfXen.dsc in your build / CI scripts.
>>
> 
> Apologies - I will fix it right away. It never occurred to me that
> 'TryRunningQemuKernel ()' is live code on OvmfXen.

Right. Such surprises are going to disappear after
<https://bugzilla.tianocore.org/show_bug.cgi?id=2122> is fixed,
hopefully around August 2020.

> Being able to drop LoadLinuxLib from the Xen build is a win in itself,

Good point, I didn't realize!

> so I will leave the Null library class for another day, if you don't
> mind.
> 

Sure, that's absolutely fine.

Thanks!
Laszlo


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#55560): https://edk2.groups.io/g/devel/message/55560
Mute This Topic: https://groups.io/mt/71749527/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list