From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web10.11826.1577974579003169741 for ; Thu, 02 Jan 2020 06:16:19 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: jiewen.yao@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Jan 2020 06:16:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,387,1571727600"; d="scan'208";a="221892561" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga003.jf.intel.com with ESMTP; 02 Jan 2020 06:16:18 -0800 Received: from fmsmsx155.amr.corp.intel.com (10.18.116.71) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 2 Jan 2020 06:16:18 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX155.amr.corp.intel.com (10.18.116.71) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 2 Jan 2020 06:16:17 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.202]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.245]) with mapi id 14.03.0439.000; Thu, 2 Jan 2020 22:16:16 +0800 From: "Yao, Jiewen" 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. Thread-Topic: [PATCH 5/6] MdeModulePkg/Smbios: Add TCG PFP rev 105 support. Thread-Index: AQHVv6XNG/s32kTXCkCU6hn7ABJpRqfXOWZAgAA0o+A= Date: Thu, 2 Jan 2020 14:16:15 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C503F8C8871@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> In-Reply-To: <0C09AFA07DD0434D9E2A0C6AEB048310404ABA11@shsmsx102.ccr.corp.intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMjQ0N2ZkNDUtZjZhOC00NTU4LThlNzYtODliOGVmNDExZjYwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoieStEXC9GRTNSbHNoSzBtVVFoRHQycW9lcW9hQXkyV2tERmsxTkh1ekR2c1FEN1Arbkk3QTVhdlA4K0FuUW8ycUUifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: jiewen.yao@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Below: > -----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= . >=20 > Minor comments. >=20 > > -----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; >=20 > Curious about that there is no standard structure defined in public heade= r > 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); >=20 > 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 following= 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_CONSU= MES ## > > SystemTable > > gEfiSmbios3TableGuid ## SOMETIMES_CONSU= MES ## > > SystemTable > > > > +[Pcd] > > + gEfiMdeModulePkgTokenSpaceGuid.PcdTcgPfpMeasurementRevision > > ## CONSUMES >=20 > To be explicit, how about adding PcdLib in inf and PcdLib.h in c? [Jiewen] Agree. I will add them. >=20 >=20 > Thanks, > Star >=20 > > + > > [Depex] > > gEfiSmbiosProtocolGuid > > > > -- > > 2.19.2.windows.1