On February 14, 2022 6:03 PM, Gerd Hoffmann wrote: > On Tue, Feb 08, 2022 at 08:20:20AM +0000, Xu, Min M wrote: > > On January 27, 2022 9:49 PM, Gerd Hoffmann wrote: > > > > + EFI_HOB_GUID_TYPE *GuidHob; > > > > + EFI_HOB_PLATFORM_INFO *PlatformInfo = NULL; > > > > > > > // Query Host Bridge DID to determine platform type > > > > + // Tdx guest stores the HostBridgePciDevId in a GuidHob. > > > > + // So we first check if this HOB exists > > > > > > Hmm, wouldn't it be better to create and use the PlatformInfo for > > > both PEI- based and PEI-less boot? > > > > > > > - HostBridgeDevId = PcdGet16 (PcdOvmfHostBridgePciDevId); > > > > + GuidHob = GetFirstGuidHob (&gUefiOvmfPkgTdxPlatformGuid); if > > > > + (GuidHob != NULL) { > > > > + PlatformInfo = (EFI_HOB_PLATFORM_INFO > *)GET_GUID_HOB_DATA > > > (GuidHob); > > > > + HostBridgeDevId = PlatformInfo->HostBridgePciDevId; } else { > > > > + HostBridgeDevId = PcdGet16 (PcdOvmfHostBridgePciDevId); } > > > > > > We would not need that kind of checks in the first place then. > > > > > As we agreed at the first stage, only OvmfPkg/PlatformPei will be refactored > with PlatformInitLib. > > OvmfPkg/Bhyve/PlatformPei and OvmfPkg/XenPlatformPei will be refactored > in the future. HostBridgeDevId is set to PcdOvmfHostBridgePciDevId in these 2 > platforms. > > So we have to check both EFI_HOB_PLATFORM_INFO and > PcdOvmfHostBridgePciDevId. > > Ok. Can you add a comment explaining this? Sure. I will add the comment to explain it.
Thanks Min -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#86653): https://edk2.groups.io/g/devel/message/86653 Mute This Topic: https://groups.io/mt/88666807/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-