From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web11.42082.1674122069155389120 for ; Thu, 19 Jan 2023 01:54:29 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RuJBqabe; spf=pass (domain: redhat.com, ip: 170.10.129.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674122067; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=7KP5W9EdhNQaNygjU1jdYztQdWd3GL6PFQ+DECcM9p8=; b=RuJBqabehdSMKWC2ZvcWfmOHvXWVjzffFH1u8GEzrlzcre159oNpMxRF0vI+5Bh4e0QOmW Y7xuX4vhuJrG2idJrKw50iPnWpBS7BRujVCjNZdUgC0+oAHkgxdeajl7o/pzVNuVZl5Yh8 /+5auuq7sf7uPtNnj1Jo+zIk/Wty7NE= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-463-tTz8rJh3NsGDkzuYkqn4yA-1; Thu, 19 Jan 2023 04:54:24 -0500 X-MC-Unique: tTz8rJh3NsGDkzuYkqn4yA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D639E858F0E; Thu, 19 Jan 2023 09:54:23 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.186]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9D5501121315; Thu, 19 Jan 2023 09:54:23 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 3CDEE180093C; Thu, 19 Jan 2023 10:54:22 +0100 (CET) Date: Thu, 19 Jan 2023 10:54:22 +0100 From: "Gerd Hoffmann" To: Min Xu Cc: devel@edk2.groups.io, Erdem Aktas , James Bottomley , Jiewen Yao , Tom Lendacky , Michael Roth Subject: Re: [PATCH V2 04/10] OvmfPkg/IntelTdx: Implement other helper functions in SecTdxHelperLib Message-ID: <20230119095422.ou5vbckdyn33hh5c@sirius.home.kraxel.org> References: <20230119032822.1406-1-min.m.xu@intel.com> <20230119032822.1406-5-min.m.xu@intel.com> MIME-Version: 1.0 In-Reply-To: <20230119032822.1406-5-min.m.xu@intel.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline > @@ -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? > +#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 ... take care, Gerd