From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web12.10436.1577963348028161981 for ; Thu, 02 Jan 2020 03:09:08 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: star.zeng@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Jan 2020 03:09:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,386,1571727600"; d="scan'208";a="252221820" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga002.fm.intel.com with ESMTP; 02 Jan 2020 03:09:07 -0800 Received: from FMSMSX109.amr.corp.intel.com (10.18.116.9) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 2 Jan 2020 03:09:07 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx109.amr.corp.intel.com (10.18.116.9) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 2 Jan 2020 03:09:06 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.202]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.55]) with mapi id 14.03.0439.000; Thu, 2 Jan 2020 19:09:04 +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/s32kTXCkCU6hn7ABJpRqfXOWZA Date: Thu, 2 Jan 2020 11:09:04 +0000 Message-ID: <0C09AFA07DD0434D9E2A0C6AEB048310404ABA11@shsmsx102.ccr.corp.intel.com> References: <20191231064412.22988-1-jiewen.yao@intel.com> <20191231064412.22988-6-jiewen.yao@intel.com> In-Reply-To: <20191231064412.22988-6-jiewen.yao@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 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. >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2439 >=20 > Report EV_EFI_HANDOFF_TABLES2 if the platform chooses PFP >=3D 105. >=20 > 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(-) >=20 > 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; >=20 > +#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? > + > +#pragma pack () > + > /** >=20 > 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? > + > + 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_CONSUME= S ## > SystemTable > gEfiSmbios3TableGuid ## SOMETIMES_CONSUME= S ## > SystemTable >=20 > +[Pcd] > + gEfiMdeModulePkgTokenSpaceGuid.PcdTcgPfpMeasurementRevision > ## CONSUMES To be explicit, how about adding PcdLib in inf and PcdLib.h in c? Thanks, Star > + > [Depex] > gEfiSmbiosProtocolGuid >=20 > -- > 2.19.2.windows.1