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.133.124]) by mx.groups.io with SMTP id smtpd.web10.74319.1674222670454374666 for ; Fri, 20 Jan 2023 05:51:10 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OOBOH98d; spf=pass (domain: redhat.com, ip: 170.10.133.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674222669; 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=a4mKaEI1nEbzK6NpuSrdRhpvWoyIzUJ+enP1x1ovvOU=; b=OOBOH98d9q/EZ/gOmB8OMG5dvbVqI8Meq3t40GNzvyEdQ6qbXi38sLs0bL2VwOgS6L8ybI DwwH3ZFIRQzuQaIVg2RNBeZuoCLiASImCwEHSaT1W4SITozosYcO7lV+PCeaFqx1NgM2ma rX8FM7huvtYk1SAjWT7o5px2S97hN7s= 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-614-JH6LAsNHM1S9w2_kHTYgig-1; Fri, 20 Jan 2023 08:51:02 -0500 X-MC-Unique: JH6LAsNHM1S9w2_kHTYgig-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4937F800B30; Fri, 20 Jan 2023 13:51:02 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.186]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 185D01415113; Fri, 20 Jan 2023 13:51:02 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 5FB19180039C; Fri, 20 Jan 2023 14:50:59 +0100 (CET) Date: Fri, 20 Jan 2023 14:50:59 +0100 From: "Gerd Hoffmann" To: "Xu, Min M" Cc: "Yao, Jiewen" , "devel@edk2.groups.io" , "Aktas, Erdem" , James Bottomley , Tom Lendacky , Michael Roth Subject: Re: [PATCH V2 04/10] OvmfPkg/IntelTdx: Implement other helper functions in SecTdxHelperLib Message-ID: <20230120135059.opht56zl4jbybg23@sirius.home.kraxel.org> References: <20230119032822.1406-1-min.m.xu@intel.com> <20230119032822.1406-5-min.m.xu@intel.com> <20230119095422.ou5vbckdyn33hh5c@sirius.home.kraxel.org> <20230120101828.jf43j7ahxqossace@sirius.home.kraxel.org> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline > > > [Jiewen] No. We cannot move to MdePkg. > > > TCG defines the field to be variable length. Something like below: > > > > > > typedef struct { > > > UINT8 TableDescriptionSize; > > > UINT8 TableDescription[TableDescriptionSize]; > > > UINT64 NumberOfTables; > > > EFI_CONFIGURATION_TABLE TableEntry[NumberOfTables]; > > > } HANDOFF_TABLE_POINTERS2; > > > > > > typedef struct { > > > UINT8 BlobDescriptionSize; > > > UINT8 BlobDescription[BlobDescriptionSize]; > > > EFI_PHYSICAL_ADDRESS BlobBase; > > > UINT64 BlobLength; > > > } HANDOFF_TABLE_POINTERS2; > > > > > > The implementation can choose its own length as they wish. > > > > Why doesn't follow TDX standard TCG practices here? > > > As Jiewen mentioned TCG defines the field to be variable length. The implementation can choose its own length. Below are some examples. > Tcg2Pei defines its FV_HANDOFF_TABLE_POINTERS2. (https://github.com/tianocore/edk2/blob/master/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c#L126-L136) > SmbiosMeasurementDxe defines its SMBIOS_HANDOFF_TABLE_POINTERS2 (https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasurementDxe.c#L113-L123) > TcgEventLogRecordLib defines the PLATFORM_FIRMWARE_BLOB2_STRUCT and HANDOFF_TABLE_POINTERS2_STRUCT. https://github.com/tianocore/edk2/blob/master/SecurityPkg/Include/Library/TcgEventLogRecordLib.h#L14-L32 > I think TDX follow the same practice above to define its own > TDX_HANDOFF_TABLE_POINTERS2 and FV_HANDOFF_TABLE_POINTERS2. > (FV_HANDOFF_TABLE_POINTERS2 happens to be same as the one in Tcg2Pei.) Ok, that makes sense. The TdHob is tdx-specific, measuring a firmware volume is not. I'm still wondering why the structs for standard events (like the firmware volume) are not in some shared header file ... take care, Gerd