On 19/07/2021 18:21, Tom Lendacky wrote:
> On 7/6/21 3:54 AM, Dov Murik wrote:
>> From: James Bottomley <[email protected]>
>>
>> Support QEMU's -kernel option.
>>
>> OvmfPkg/Library/PlatformBootManagerLibGrub/QemuKernel.c is an exact copy
>> of OvmfPkg/Library/PlatformBootManagerLib/QemuKernel.c .
> 
> Just a nit, but this confused me initially. Maybe it should say something
> along the lines of create a QemuKernel.c for PlatformBootManagerLibGrub
> that is an exact copy of the file from PlatformBootManagerLib.
> 

You're right; I'll write it clearer.


> Is there any way that the two libraries can use the same file rather than
> making an exact copy?

I guess it's possible by extracting the file into its own library?  I'll
need to take a deeper look.

-Dov


> 
> Thanks,
> Tom
> 
>>
>> Cc: Laszlo Ersek <[email protected]>
>> Cc: Ard Biesheuvel <[email protected]>
>> Cc: Jordan Justen <[email protected]>
>> Cc: Ashish Kalra <[email protected]>
>> Cc: Brijesh Singh <[email protected]>
>> Cc: Erdem Aktas <[email protected]>
>> Cc: James Bottomley <[email protected]>
>> Cc: Jiewen Yao <[email protected]>
>> Cc: Min Xu <[email protected]>
>> Cc: Tom Lendacky <[email protected]>
>> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3457
>> Signed-off-by: James Bottomley <[email protected]>
>> ---
>>  OvmfPkg/AmdSev/AmdSevX64.dsc                                                
>>         |  1 +
>>  OvmfPkg/Library/PlatformBootManagerLibGrub/PlatformBootManagerLibGrub.inf   
>>         |  2 ++
>>  OvmfPkg/Library/PlatformBootManagerLibGrub/BdsPlatform.h                    
>>         | 11 +++++++++++
>>  OvmfPkg/Library/PlatformBootManagerLibGrub/BdsPlatform.c                    
>>         |  5 +++++
>>  OvmfPkg/Library/{PlatformBootManagerLib => 
>> PlatformBootManagerLibGrub}/QemuKernel.c |  0
>>  5 files changed, 19 insertions(+)
>>
>> diff --git a/OvmfPkg/AmdSev/AmdSevX64.dsc b/OvmfPkg/AmdSev/AmdSevX64.dsc
>> index a2f1324c40a6..aefdcf881c99 100644
>> --- a/OvmfPkg/AmdSev/AmdSevX64.dsc
>> +++ b/OvmfPkg/AmdSev/AmdSevX64.dsc
>> @@ -281,6 +281,7 @@ [LibraryClasses.common.PEIM]
>>    
>> CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.inf
>>    MpInitLib|UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf
>>    QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/PeiQemuFwCfgS3LibFwCfg.inf
>> +  
>> QemuLoadImageLib|OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.inf
>>    PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
>>    QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgPeiLib.inf
>>  
>> diff --git 
>> a/OvmfPkg/Library/PlatformBootManagerLibGrub/PlatformBootManagerLibGrub.inf 
>> b/OvmfPkg/Library/PlatformBootManagerLibGrub/PlatformBootManagerLibGrub.inf
>> index 9a806d17ec45..5f6f73d18470 100644
>> --- 
>> a/OvmfPkg/Library/PlatformBootManagerLibGrub/PlatformBootManagerLibGrub.inf
>> +++ 
>> b/OvmfPkg/Library/PlatformBootManagerLibGrub/PlatformBootManagerLibGrub.inf
>> @@ -23,6 +23,7 @@ [Defines]
>>  
>>  [Sources]
>>    BdsPlatform.c
>> +  QemuKernel.c
>>    PlatformData.c
>>    BdsPlatform.h
>>  
>> @@ -46,6 +47,7 @@ [LibraryClasses]
>>    BootLogoLib
>>    DevicePathLib
>>    PciLib
>> +  QemuLoadImageLib
>>    UefiLib
>>    PlatformBmPrintScLib
>>    Tcg2PhysicalPresenceLib
>> diff --git a/OvmfPkg/Library/PlatformBootManagerLibGrub/BdsPlatform.h 
>> b/OvmfPkg/Library/PlatformBootManagerLibGrub/BdsPlatform.h
>> index 748c63081920..f1d3a2906c00 100644
>> --- a/OvmfPkg/Library/PlatformBootManagerLibGrub/BdsPlatform.h
>> +++ b/OvmfPkg/Library/PlatformBootManagerLibGrub/BdsPlatform.h
>> @@ -172,4 +172,15 @@ PlatformInitializeConsole (
>>    IN PLATFORM_CONSOLE_CONNECT_ENTRY   *PlatformConsole
>>    );
>>  
>> +/**
>> +  Loads and boots UEFI Linux via the FwCfg interface.
>> +
>> +  @retval    EFI_NOT_FOUND - The Linux kernel was not found
>> +
>> +**/
>> +EFI_STATUS
>> +TryRunningQemuKernel (
>> +  VOID
>> +  );
>> +
>>  #endif // _PLATFORM_SPECIFIC_BDS_PLATFORM_H_
>> diff --git a/OvmfPkg/Library/PlatformBootManagerLibGrub/BdsPlatform.c 
>> b/OvmfPkg/Library/PlatformBootManagerLibGrub/BdsPlatform.c
>> index 5c92d4fc2b09..7cceeea4879c 100644
>> --- a/OvmfPkg/Library/PlatformBootManagerLibGrub/BdsPlatform.c
>> +++ b/OvmfPkg/Library/PlatformBootManagerLibGrub/BdsPlatform.c
>> @@ -1315,6 +1315,11 @@ PlatformBootManagerAfterConsole (
>>    //
>>    Tcg2PhysicalPresenceLibProcessRequest (NULL);
>>  
>> +  //
>> +  // Process QEMU's -kernel command line option
>> +  //
>> +  TryRunningQemuKernel ();
>> +
>>    //
>>    // Perform some platform specific connect sequence
>>    //
>> diff --git a/OvmfPkg/Library/PlatformBootManagerLib/QemuKernel.c 
>> b/OvmfPkg/Library/PlatformBootManagerLibGrub/QemuKernel.c
>> similarity index 100%
>> copy from OvmfPkg/Library/PlatformBootManagerLib/QemuKernel.c
>> copy to OvmfPkg/Library/PlatformBootManagerLibGrub/QemuKernel.c
>>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#77916): https://edk2.groups.io/g/devel/message/77916
Mute This Topic: https://groups.io/mt/84016356/21656
Group Owner: [email protected]
Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to