On January 19, 2023 5:54 PM, Gerd Hoffmann wrote:
> > @@ -807,7 +880,47 @@ TdxHelperMeasureTdHob (
> > VOID
> > )
> > {
> > - return EFI_UNSUPPORTED;
> > + EFI_PEI_HOB_POINTERS Hob;
> > + EFI_STATUS Status;
> > + UINT8 Digest[SHA384_DIGEST_SIZE];
> > + OVMF_WORK_AREA *WorkArea;
> > + VOID *TdHob;
> > +
> > + TdHob = (VOID *)(UINTN)FixedPcdGet32 (PcdOvmfSecGhcbBase);
> > + Hob.Raw = (UINT8 *)TdHob;
> > +
> > + //
> > + // Walk thru the TdHob list until end of list.
> > + //
> > + while (!END_OF_HOB_LIST (Hob)) {
> > + Hob.Raw = GET_NEXT_HOB (Hob);
> > + }
>
> Hmm? Isn't there just a single TdHob? Why do you need to walk the list here?
No, TdHob is a HobList and it contains several Hobs, including the
ResourceDescriptorHobs which describe the memory regions. So we have to walk
thru the hob list to find out its length.
>
> > +#pragma pack(1)
> > +
> > +#define HANDOFF_TABLE_DESC "TdxTable"
> > +typedef struct {
> > + UINT8 TableDescriptionSize;
> > + UINT8 TableDescription[sizeof (HANDOFF_TABLE_DESC)];
> > + UINT64 NumberOfTables;
> > + EFI_CONFIGURATION_TABLE TableEntry[1];
> > +} TDX_HANDOFF_TABLE_POINTERS2;
> > +
> > +#define FV_HANDOFF_TABLE_DESC "Fv(XXXXXXXX-XXXX-XXXX-XXXX-
> XXXXXXXXXXXX)"
> > +typedef struct {
> > + UINT8 BlobDescriptionSize;
> > + UINT8 BlobDescription[sizeof (FV_HANDOFF_TABLE_DESC)];
> > + EFI_PHYSICAL_ADDRESS BlobBase;
> > + UINT64 BlobLength;
> > +} FV_HANDOFF_TABLE_POINTERS2;
> > +
> > +#pragma pack()
>
> Why do you need this? For standard event types we should have those
> structs already defined somewhere in edk2 I think ...
These structs are defined in SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c. Let me think
can they be moved to a common header file. Thanks for reminder.
Thanks
Min
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#98907): https://edk2.groups.io/g/devel/message/98907
Mute This Topic: https://groups.io/mt/96370898/21656
Group Owner: [email protected]
Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-