From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web12.2419.1578012861111050666 for ; Thu, 02 Jan 2020 16:54:21 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: star.zeng@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Jan 2020 16:54:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,388,1571727600"; d="scan'208";a="369462462" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga004.jf.intel.com with ESMTP; 02 Jan 2020 16:54:20 -0800 Received: from shsmsx154.ccr.corp.intel.com (10.239.6.54) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 2 Jan 2020 16:54:20 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.202]) by SHSMSX154.ccr.corp.intel.com ([169.254.7.132]) with mapi id 14.03.0439.000; Fri, 3 Jan 2020 08:54:18 +0800 From: "Zeng, Star" To: "Yao, Jiewen" , "devel@edk2.groups.io" CC: "Wang, Jian J" , "Wu, Hao A" , "Bi, Dandan" , "Zeng, Star" Subject: Re: [PATCH 5/6] MdeModulePkg/Smbios: Add TCG PFP rev 105 support. Thread-Topic: [PATCH 5/6] MdeModulePkg/Smbios: Add TCG PFP rev 105 support. Thread-Index: AQHVv6XNG/s32kTXCkCU6hn7ABJpRqfXOWZAgAA0o+CAALLiEA== Date: Fri, 3 Jan 2020 00:54:17 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB048310404AC636@shsmsx102.ccr.corp.intel.com> References: <20191231064412.22988-1-jiewen.yao@intel.com> <20191231064412.22988-6-jiewen.yao@intel.com> <0C09AFA07DD0434D9E2A0C6AEB048310404ABA11@shsmsx102.ccr.corp.intel.com> <74D8A39837DF1E4DA445A8C0B3885C503F8C8871@shsmsx102.ccr.corp.intel.com> In-Reply-To: <74D8A39837DF1E4DA445A8C0B3885C503F8C8871@shsmsx102.ccr.corp.intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: star.zeng@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: Yao, Jiewen > Sent: Thursday, January 2, 2020 10:16 PM > To: Zeng, Star ; devel@edk2.groups.io > Cc: Wang, Jian J ; Wu, Hao A ; > Bi, Dandan > Subject: RE: [PATCH 5/6] MdeModulePkg/Smbios: Add TCG PFP rev 105 > support. >=20 > Below: >=20 > > -----Original Message----- > > From: Zeng, Star > > Sent: Thursday, January 2, 2020 7:09 PM > > To: Yao, Jiewen ; devel@edk2.groups.io > > Cc: Wang, Jian J ; Wu, Hao A > > ; Bi, Dandan ; Zeng, Star > > > > Subject: RE: [PATCH 5/6] MdeModulePkg/Smbios: Add TCG PFP rev 105 > support. > > > > Minor comments. > > > > > -----Original Message----- > > > From: Yao, Jiewen > > > Sent: Tuesday, December 31, 2019 2:44 PM > > > To: devel@edk2.groups.io > > > Cc: Wang, Jian J ; Wu, Hao A > > > ; Bi, Dandan ; Zeng, Star > > > > > > Subject: [PATCH 5/6] MdeModulePkg/Smbios: Add TCG PFP rev 105 > support. > > > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2439 > > > > > > Report EV_EFI_HANDOFF_TABLES2 if the platform chooses PFP >=3D 105. > > > > > > Cc: Jian J Wang > > > Cc: Hao A Wu > > > Cc: Dandan Bi > > > Cc: Star Zeng > > > Signed-off-by: Jiewen Yao > > > --- > > > .../SmbiosMeasurementDxe.c | 35 +++++++++++++++++= -- > > > .../SmbiosMeasurementDxe.inf | 3 ++ > > > 2 files changed, 35 insertions(+), 3 deletions(-) > > > > > > diff --git > > > > a/MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasuremen > > > tDxe.c > > > > b/MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasureme > > > ntDxe.c > > > index 5ec2aca095..a5839c09f1 100644 > > > --- > > > > a/MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasuremen > > > tDxe.c > > > +++ > > > > b/MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasureme > > > ntDxe.c > > > @@ -108,6 +108,18 @@ SMBIOS_FILTER_STRUCT > > > mSmbiosFilterStandardTableBlackList[] =3D { EFI_SMBIOS_PROTOCOL > > > *mSmbios; > > > UINTN mMaxLen; > > > > > > +#pragma pack (1) > > > + > > > +#define SMBIOS_HANDOFF_TABLE_DESC "SmbiosTable" > > > +typedef struct { > > > + UINT8 TableDescriptionSize; > > > + UINT8 > > > TableDescription[sizeof(SMBIOS_HANDOFF_TABLE_DESC)]; > > > + UINT64 NumberOfTables; > > > + EFI_CONFIGURATION_TABLE TableEntry[1]; > > > +} SMBIOS_HANDOFF_TABLE_POINTERS2; > > > > Curious about that there is no standard structure defined in public > > header instead of defining it internal here? > [Jiewen] Right. The first byte is the size of the following description. > The table owner may define different description for the table. >=20 > > > > > + > > > +#pragma pack () > > > + > > > /** > > > > > > This function dump raw data. > > > @@ -460,6 +472,10 @@ MeasureSmbiosTable ( { > > > EFI_STATUS Status; > > > EFI_HANDOFF_TABLE_POINTERS HandoffTables; > > > + SMBIOS_HANDOFF_TABLE_POINTERS2 SmbiosHandoffTables2; > > > + UINT32 EventType; > > > + VOID *EventLog; > > > + UINT32 EventLogSize; > > > SMBIOS_TABLE_ENTRY_POINT *SmbiosTable; > > > SMBIOS_TABLE_3_0_ENTRY_POINT *Smbios3Table; > > > VOID *SmbiosTableAddress; > > > @@ -569,11 +585,24 @@ MeasureSmbiosTable ( > > > CopyGuid (&(HandoffTables.TableEntry[0].VendorGuid), > > > &gEfiSmbiosTableGuid); > > > HandoffTables.TableEntry[0].VendorTable =3D SmbiosTable; > > > } > > > + EventType =3D EV_EFI_HANDOFF_TABLES; > > > + EventLog =3D &HandoffTables; > > > + EventLogSize =3D sizeof (HandoffTables); > > > > How about making them into the else condition in the if condition below= ? > [Jiewen] My purpose is that all the rev 105 content are scoped in followi= ng if. > For rev 0, people can just see the above logic. > It is more straight forward than putting partial of logic into else. >=20 > > > > > + > > > + if (PcdGet32(PcdTcgPfpMeasurementRevision) >=3D > > > TCG_EfiSpecIDEventStruct_SPEC_ERRATA_TPM2_REV_105) { > > > + SmbiosHandoffTables2.TableDescriptionSize =3D > > > sizeof(SmbiosHandoffTables2.TableDescription); > > > + CopyMem (SmbiosHandoffTables2.TableDescription, > > > SMBIOS_HANDOFF_TABLE_DESC, > > > sizeof(SmbiosHandoffTables2.TableDescription)); > > > + SmbiosHandoffTables2.NumberOfTables =3D > > > HandoffTables.NumberOfTables; > > > + CopyMem (&(SmbiosHandoffTables2.TableEntry[0]), > > > &(HandoffTables.TableEntry[0]), > > > sizeof(SmbiosHandoffTables2.TableEntry[0])); > > > + EventType =3D EV_EFI_HANDOFF_TABLES2; > > > + EventLog =3D &SmbiosHandoffTables2; > > > + EventLogSize =3D sizeof (SmbiosHandoffTables2); > > > + } > > > Status =3D TpmMeasureAndLogData ( > > > 1, // PCRIndex > > > - EV_EFI_HANDOFF_TABLES, // EventType > > > - &HandoffTables, // EventLog > > > - sizeof (HandoffTables), // LogLen > > > + EventType, // EventType > > > + EventLog, // EventLog > > > + EventLogSize, // LogLen > > > TableAddress, // HashData > > > TableLength // HashDataLen > > > ); > > > diff --git > > > > a/MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasuremen > > > tDxe.inf > > > > b/MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasureme > > > ntDxe.inf > > > index a074044c84..81d3655dc7 100644 > > > --- > > > > a/MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasuremen > > > tDxe.inf > > > +++ > > > > b/MdeModulePkg/Universal/SmbiosMeasurementDxe/SmbiosMeasureme > > > ntDxe.i > > > +++ nf > > > @@ -57,6 +57,9 @@ > > > gEfiSmbiosTableGuid ## SOMETIMES_CON= SUMES ## > > > SystemTable > > > gEfiSmbios3TableGuid ## SOMETIMES_CON= SUMES ## > > > SystemTable > > > > > > +[Pcd] > > > + gEfiMdeModulePkgTokenSpaceGuid.PcdTcgPfpMeasurementRevision > > > ## CONSUMES > > > > To be explicit, how about adding PcdLib in inf and PcdLib.h in c? > [Jiewen] Agree. I will add them. Reviewed-by: Star Zeng No need send new patch series just for this, you can do them when doing pul= l-request. Star >=20 >=20 > > > > > > Thanks, > > Star > > > > > + > > > [Depex] > > > gEfiSmbiosProtocolGuid > > > > > > -- > > > 2.19.2.windows.1