From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web10.5805.1596358009674817596 for ; Sun, 02 Aug 2020 01:46:49 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=U3XuzrX+; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: jiewen.yao@intel.com) IronPort-SDR: 28OEKC/O6dFM9cRdaFzIT5JIiO60dv50HhEed2tHLT4AwiRbRVMHTPd0boawCJaqUAGfrvmp8N 7lWLIGJNqBPw== X-IronPort-AV: E=McAfee;i="6000,8403,9700"; a="236852856" X-IronPort-AV: E=Sophos;i="5.75,425,1589266800"; d="scan'208";a="236852856" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Aug 2020 01:46:48 -0700 IronPort-SDR: R9Jp7GpxPZg6+rK2R0XMdVCzuiJZH7DjzcSMNCPMVQh9oW12+48/qNKEW0EHd/om9pR3pJHo0L qPkOmbMEGDUQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,425,1589266800"; d="scan'208";a="274915010" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by fmsmga008.fm.intel.com with ESMTP; 02 Aug 2020 01:46:48 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Sun, 2 Aug 2020 01:46:48 -0700 Received: from fmsmsx606.amr.corp.intel.com (10.18.126.86) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Sun, 2 Aug 2020 01:46:47 -0700 Received: from FMSEDG001.ED.cps.intel.com (10.1.192.133) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Sun, 2 Aug 2020 01:46:47 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.171) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 2 Aug 2020 01:46:32 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kwQYHqExTFvM3zfzWv2m19Nl/PDi521emZYrH6JJTqYyrhfJjHPsZhiAJxhkqWXTqngJzbZ39c3gieAyRG4spq0xHzzof2PzuS/HQs00X03rtpJATptNjrIF+l2RxW03w1aYtvL+FHxzn1OrCzSmr7REN4t2OCchUsveZjchcRv3lVpTwHLVgmbtVCpu7Cvthcccr9t+wVQ6KCVUNWLkO7K0hGH+GwgoAAzRyTErSzdPXo1NQferVNDqeWIztQ+Lma/cKEAb7fTDtUzj17mR9RQPQO8CDyfd0Bd7F1j7VlClpLhfjAheBIjPllksPkIpCh1OmIHDdFIRovq17AzBsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/tC15rQJaV82jUvlxqKqyPBdB7xsqyjUn2Rnhcu1tVY=; b=BiVMACY7v68/cl28bIYUJPAfi3B/ajuekvkY3fHVbj2pxZMpmJ25hIBWPR47t7khaMV2VOrp6RlNZLQhdMfSOl2PlYieLNgbRATVZkPqTCB102e23nkdtvoOE3g/+ULdbKCp9W82JDqEBrWW3DIOs5hLuzdl5cOcqqa+VCRpBfFwkLU2dWPQptsbp03upX2vwNhwN325p16/So2cVYVIiblLcPrVdTJf6I2vCx8Ty/qJ5gAG5+vqtA8DtkL5OEzuRevzcOh8OV3T5reFZUmgov+moFaxavDVKXmuBU0vH2D4sf4Cj2pHfWi/XgJlN9tLXOYfKxmvGEay19GafhKjZA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/tC15rQJaV82jUvlxqKqyPBdB7xsqyjUn2Rnhcu1tVY=; b=U3XuzrX+BkeP6OtLgAAwqTdwkxSwvYcouHqC15J0KVFA4NDH7MNq5w0MoDup1ft3z73s2Yeh6c5vNgoBzUXXB8hxYGG5h3wz50iDVCchhZMKGlfnwv3rLBQEB5tmx20h/+B1ZIQaTK7Mxj6x48PjtAeVeR1SzevGXkIfd2PG8JU= Received: from CY4PR11MB1288.namprd11.prod.outlook.com (2603:10b6:903:23::8) by CY4PR11MB1640.namprd11.prod.outlook.com (2603:10b6:910:8::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3239.20; Sun, 2 Aug 2020 08:46:30 +0000 Received: from CY4PR11MB1288.namprd11.prod.outlook.com ([fe80::8cfa:f914:1ef2:9bbf]) by CY4PR11MB1288.namprd11.prod.outlook.com ([fe80::8cfa:f914:1ef2:9bbf%7]) with mapi id 15.20.3239.021; Sun, 2 Aug 2020 08:46:30 +0000 From: "Yao, Jiewen" To: "Zhang, Qi1" , "devel@edk2.groups.io" CC: "Chiu, Chasel" , "Desimone, Nathaniel L" , "Zeng, Star" Subject: Re: [PATCH 7/9] IntelFsp2WraperPkg/Fsp{m|s}WrapperPeim: Add FspBin measurement. Thread-Topic: [PATCH 7/9] IntelFsp2WraperPkg/Fsp{m|s}WrapperPeim: Add FspBin measurement. Thread-Index: AQHWZxhNYe0Kem6MG0eabvmLRDb+aKkkhIRA Date: Sun, 2 Aug 2020 08:46:30 +0000 Message-ID: References: <20200731085437.16070-1-qi1.zhang@intel.com> <20200731085437.16070-8-qi1.zhang@intel.com> In-Reply-To: <20200731085437.16070-8-qi1.zhang@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNWZkNmM3NWUtMDM0Zi00MmJjLWE2YTItN2YyOTAxNjlhMjljIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiVUEyMkdSN1NJWitLSFhZcWhvUWxPZk9EZjdhT0g3dzhpa2JicjBZXC9BamlWQzlZY1wvd2ZMd3RqOGE3a05cL0tpYiJ9 x-ctpclassification: CTP_NT dlp-version: 11.5.1.3 dlp-product: dlpe-windows dlp-reaction: no-action authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.198.147.216] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 91532fd8-12a4-4314-e466-08d836c08d82 x-ms-traffictypediagnostic: CY4PR11MB1640: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: MOWs8mjW3BZhF2wIcEo1h+erbbHcl0bn6VVCwMO6HX6Y9iu/RlwVXIjfH+YtenicBZ0HxPzRQlWV0orr92Hczlsmd2M5fENH43pacd5bMzqbbWThwkpiTXV2AgmFnDzy2xKFZ10Py27iwbko3pTMQjX00sIl+QfyzN7w/QSW6Opl/BWUdyoJXi76KJskOda5528pKLkCynM/vHalwZdD94ljiWtlIANHvrrOUNAas36HTbXF28dY0CuhlmC6nw0nNhASmnUNlKvc/AZPsB6mb+fIpIllBbCpsrK/gqB3En+aysSEMsLqCIwfOgmw0ao8/aGLz4mV3iCQanuCs6ge9/NyHY2xsTxMRXxSNr+Xs6PriiOvA4Q+TVQanUROMYyAUW0p533u0/8bbU1xDBPVqw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY4PR11MB1288.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(376002)(346002)(39860400002)(366004)(136003)(396003)(966005)(26005)(186003)(53546011)(86362001)(2906002)(33656002)(52536014)(55016002)(54906003)(66446008)(66556008)(71200400001)(8936002)(4326008)(64756008)(66476007)(76116006)(8676002)(19627235002)(107886003)(9686003)(7696005)(6506007)(110136005)(478600001)(66946007)(30864003)(316002)(5660300002)(83380400001)(579004);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: ZqAVonJCTn95cVOFWTOwWRZ57jHnu2zuC6GUWlF8tkaHBkn74c91BeMbvGFqwOvy3Yi+SzM18DNQQEPniVUTgRMAS/La7QLnXohkHmyl3BcQmz5AISsFpxGWbUS/49rGdp/AvBiwIugDthq937dSdcX2iJUbQOUI4GdWEH+7WBfrurkmNpxZqc7cWVkPwhDRLmt/Xez6loTPB4ZLSzuilEAP941sm5HtnPV55WJjzbo0RlHu+ASo6a3SybQf/quDL954TQIuwmgr3gsg1sioba2ee/l23dXgtC4kHAIx9std8ulqYR6ZDCGQtdmnpxIzJeHFfJxbsa5oy2qWDBBvq5tshMj5lf37l+uPdVN7ewgF9HM+CFGrRHJVckiYD7SIGnvSCzLKP5VaDC/qEbd2l+T8XElFJtV55KfogeEdqAUgiyBPIGhSwTMZi2lUfpa9OMYWkeKSrZzLTQNZoOLXubhDOFPU1lKfGdGHS3vZHa4ecmlgPmoWmvttfjX75rx+rEf7emfGBd4wyX/FKUN1EBq8yTHSCHCwi93I3jN+xZdX6bPcTTcqyMzAZkksyNw7x4bHzo5IVxB02NcoIKktI6XIUeWimoo5CMDFjVGyE41sSHPQD/pxIynh8S2ELw/ko4kY1+WnbN9ojRcIDTMzKg== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CY4PR11MB1288.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 91532fd8-12a4-4314-e466-08d836c08d82 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Aug 2020 08:46:30.7122 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: PzhTaMRkBT9Mio1Yb13GQVGMIfkKQZ4bUpi8aJ2eIeJyCCFATNzawGIUHrBuIquNeJM8QzQl3p+CILftChmw1Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR11MB1640 Return-Path: jiewen.yao@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Please remove FSP_MEASURE_FSPUPD check here. It should be checked in FspMeasurementLib. Thank you Yao Jiewen > -----Original Message----- > From: Zhang, Qi1 > Sent: Friday, July 31, 2020 4:55 PM > To: devel@edk2.groups.io > Cc: Yao, Jiewen ; Chiu, Chasel ; > Desimone, Nathaniel L ; Zeng, Star > ; Zhang, Qi1 > Subject: [PATCH 7/9] IntelFsp2WraperPkg/Fsp{m|s}WrapperPeim: Add FspBin > measurement. >=20 > From: Jiewen Yao >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2376 >=20 > Cc: Jiewen Yao > Cc: Chasel Chiu > Cc: Nate DeSimone > Cc: Star Zeng > Cc: Qi Zhang > Signed-off-by: Jiewen Yao > --- > .../FspmWrapperPeim/FspmWrapperPeim.c | 115 +++++++++++++++++- > .../FspmWrapperPeim/FspmWrapperPeim.inf | 20 ++- > .../FspsWrapperPeim/FspsWrapperPeim.c | 96 ++++++++++++++- > .../FspsWrapperPeim/FspsWrapperPeim.inf | 27 ++-- > 4 files changed, 239 insertions(+), 19 deletions(-) >=20 > diff --git a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c > b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c > index 265b77ed60..1533971d7f 100644 > --- a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c > +++ b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c > @@ -3,7 +3,7 @@ > register TemporaryRamDonePpi to call TempRamExit API, and register > MemoryDiscoveredPpi >=20 > notify to call FspSiliconInit API. >=20 >=20 >=20 > - Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.
>=20 > + Copyright (c) 2014 - 2020, Intel Corporation. All rights reserved.
>=20 > SPDX-License-Identifier: BSD-2-Clause-Patent >=20 >=20 >=20 > **/ >=20 > @@ -25,11 +25,14 @@ > #include >=20 > #include >=20 > #include >=20 > +#include >=20 >=20 >=20 > #include >=20 > #include >=20 > #include >=20 > #include >=20 > +#include >=20 > +#include >=20 > #include >=20 > #include >=20 > #include >=20 > @@ -147,7 +150,21 @@ FspmWrapperInit ( > VOID >=20 > ) >=20 > { >=20 > - EFI_STATUS Status; >=20 > + EFI_STATUS Status; >=20 > + EFI_PEI_FIRMWARE_VOLUME_INFO_MEASUREMENT_EXCLUDED_PPI > *MeasurementExcludedFvPpi; >=20 > + EFI_PEI_PPI_DESCRIPTOR *MeasurementExcl= udedPpiList; >=20 > + >=20 > + MeasurementExcludedFvPpi =3D AllocatePool > (sizeof(*MeasurementExcludedFvPpi)); >=20 > + ASSERT(MeasurementExcludedFvPpi !=3D NULL); >=20 > + MeasurementExcludedFvPpi->Count =3D 1; >=20 > + MeasurementExcludedFvPpi->Fv[0].FvBase =3D PcdGet32 (PcdFspmBaseAddres= s); >=20 > + MeasurementExcludedFvPpi->Fv[0].FvLength =3D > ((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 > (PcdFspmBaseAddress))->FvLength; >=20 > + >=20 > + MeasurementExcludedPpiList =3D AllocatePool > (sizeof(*MeasurementExcludedPpiList)); >=20 > + ASSERT(MeasurementExcludedPpiList !=3D NULL); >=20 > + MeasurementExcludedPpiList->Flags =3D EFI_PEI_PPI_DESCRIPTOR_PPI | > EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST; >=20 > + MeasurementExcludedPpiList->Guid =3D > &gEfiPeiFirmwareVolumeInfoMeasurementExcludedPpiGuid; >=20 > + MeasurementExcludedPpiList->Ppi =3D MeasurementExcludedFvPpi; >=20 >=20 >=20 > Status =3D EFI_SUCCESS; >=20 >=20 >=20 > @@ -155,6 +172,9 @@ FspmWrapperInit ( > Status =3D PeiFspMemoryInit (); >=20 > ASSERT_EFI_ERROR (Status); >=20 > } else { >=20 > + Status =3D PeiServicesInstallPpi (MeasurementExcludedPpiList); >=20 > + ASSERT_EFI_ERROR (Status); >=20 > + >=20 > PeiServicesInstallFvInfoPpi ( >=20 > NULL, >=20 > (VOID *)(UINTN) PcdGet32 (PcdFspmBaseAddress), >=20 > @@ -167,6 +187,92 @@ FspmWrapperInit ( > return Status; >=20 > } >=20 >=20 >=20 > +/** >=20 > + This function is called after TCG installed PPI. >=20 > + >=20 > + @param[in] PeiServices Pointer to PEI Services Table. >=20 > + @param[in] NotifyDesc Pointer to the descriptor for the Notificati= on event > that >=20 > + caused this function to execute. >=20 > + @param[in] Ppi Pointer to the PPI data associated with this= function. >=20 > + >=20 > + @retval EFI_STATUS Always return EFI_SUCCESS >=20 > +**/ >=20 > +EFI_STATUS >=20 > +EFIAPI >=20 > +TcgPpiNotify ( >=20 > + IN EFI_PEI_SERVICES **PeiServices, >=20 > + IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc, >=20 > + IN VOID *Ppi >=20 > + ); >=20 > + >=20 > +EFI_PEI_NOTIFY_DESCRIPTOR mTcgPpiNotifyDesc =3D { >=20 > + (EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | > EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST), >=20 > + &gEdkiiTcgPpiGuid, >=20 > + TcgPpiNotify >=20 > +}; >=20 > + >=20 > +/** >=20 > + This function is called after TCG installed PPI. >=20 > + >=20 > + @param[in] PeiServices Pointer to PEI Services Table. >=20 > + @param[in] NotifyDesc Pointer to the descriptor for the Notificati= on event > that >=20 > + caused this function to execute. >=20 > + @param[in] Ppi Pointer to the PPI data associated with this= function. >=20 > + >=20 > + @retval EFI_STATUS Always return EFI_SUCCESS >=20 > +**/ >=20 > +EFI_STATUS >=20 > +EFIAPI >=20 > +TcgPpiNotify ( >=20 > + IN EFI_PEI_SERVICES **PeiServices, >=20 > + IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc, >=20 > + IN VOID *Ppi >=20 > + ) >=20 > +{ >=20 > + UINT32 FspMeasureMask; >=20 > + FSP_INFO_HEADER *FspHeaderPtr; >=20 > + >=20 > + DEBUG ((DEBUG_INFO, "TcgPpiNotify FSPM\n")); >=20 > + >=20 > + FspMeasureMask =3D PcdGet32 (PcdFspMeasurementConfig); >=20 > + if (FspMeasureMask & FSP_MEASURE_FSP) { >=20 > + if (FspMeasureMask & FSP_MEASURE_FSPT) { >=20 > + if(FspMeasureMask & FSP_MEASURE_FSPUPD) { >=20 > + FspHeaderPtr =3D (FSP_INFO_HEADER *) FspFindFspHeader (PcdGet32 > (PcdFsptBaseAddress)); >=20 > + if (FspHeaderPtr =3D=3D NULL) { >=20 > + return EFI_DEVICE_ERROR; >=20 > + } >=20 > + DEBUG ((DEBUG_INFO, "FSPT: CfgRegionOffset 0x%x, CfgRegionSize > 0x%x\n", FspHeaderPtr->CfgRegionOffset, FspHeaderPtr->CfgRegionSize)); >=20 > + DEBUG ((DEBUG_INFO, "FSPT: PcdFsptBaseAddress 0x%x, ImageBase > 0x%x\n", PcdGet32(PcdFsptBaseAddress), FspHeaderPtr->ImageBase)); >=20 > + MeasureFspFirmwareBlobWithCfg ("FSPT", PcdGet32(PcdFsptBaseAddre= ss), >=20 > + (UINT32)((EFI_FIRMWARE_VOLUME_HEA= DER *) (UINTN) > PcdGet32 (PcdFsptBaseAddress))->FvLength, >=20 > + FspHeaderPtr->CfgRegionOffset, Fs= pHeaderPtr- > >CfgRegionSize); >=20 > + } else { >=20 > + DEBUG ((DEBUG_ERROR, "\n QIZ: Measure FSPT\n")); >=20 > + MeasureFspFirmwareBlob (0, "FSPT", PcdGet32(PcdFsptBaseAddress), >=20 > + (UINT32)((EFI_FIRMWARE_VOLUME_HEADER *) = (UINTN) > PcdGet32 (PcdFsptBaseAddress))->FvLength); >=20 > + } >=20 > + } >=20 > + if (FspMeasureMask & FSP_MEASURE_FSPM) { >=20 > + if(FspMeasureMask & FSP_MEASURE_FSPUPD) { >=20 > + FspHeaderPtr =3D (FSP_INFO_HEADER *) FspFindFspHeader (PcdGet32 > (PcdFspmBaseAddress)); >=20 > + if (FspHeaderPtr =3D=3D NULL) { >=20 > + return EFI_DEVICE_ERROR; >=20 > + } >=20 > + MeasureFspFirmwareBlobWithCfg ("FSPM", > PcdGet32(PcdFspmBaseAddress), >=20 > + (UINT32)((EFI_FIRMWARE_VOLUME_HEA= DER *) (UINTN) > PcdGet32 (PcdFspmBaseAddress))->FvLength, >=20 > + FspHeaderPtr->CfgRegionOffset, Fs= pHeaderPtr- > >CfgRegionSize); >=20 > + } >=20 > + else { >=20 > + MeasureFspFirmwareBlob (0, "FSPM", PcdGet32(PcdFspmBaseAddress), >=20 > + (UINT32)((EFI_FIRMWARE_VOLUME_HEADER *) = (UINTN) > PcdGet32 (PcdFspmBaseAddress))->FvLength); >=20 > + } >=20 > + } >=20 > + } >=20 > + >=20 > + return EFI_SUCCESS; >=20 > +} >=20 > + >=20 > /** >=20 > This is the entrypoint of PEIM >=20 >=20 >=20 > @@ -182,8 +288,13 @@ FspmWrapperPeimEntryPoint ( > IN CONST EFI_PEI_SERVICES **PeiServices >=20 > ) >=20 > { >=20 > + EFI_STATUS Status; >=20 > + >=20 > DEBUG((DEBUG_INFO, "FspmWrapperPeimEntryPoint\n")); >=20 >=20 >=20 > + Status =3D PeiServicesNotifyPpi (&mTcgPpiNotifyDesc); >=20 > + ASSERT_EFI_ERROR (Status); >=20 > + >=20 > FspmWrapperInit (); >=20 >=20 >=20 > return EFI_SUCCESS; >=20 > diff --git a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf > b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf > index dce7ef3d0b..c3578397b6 100644 > --- a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf > +++ b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf > @@ -6,7 +6,7 @@ > # register TemporaryRamDonePpi to call TempRamExit API, and register > MemoryDiscoveredPpi >=20 > # notify to call FspSiliconInit API. >=20 > # >=20 > -# Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved. >=20 > +# Copyright (c) 2014 - 2020, Intel Corporation. All rights reserved. >=20 > # >=20 > # SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > # >=20 > @@ -44,17 +44,22 @@ > TimerLib >=20 > FspWrapperApiLib >=20 > FspWrapperApiTestLib >=20 > + FspMeasurementLib >=20 >=20 >=20 > [Packages] >=20 > MdePkg/MdePkg.dec >=20 > + MdeModulePkg/MdeModulePkg.dec >=20 > UefiCpuPkg/UefiCpuPkg.dec >=20 > + SecurityPkg/SecurityPkg.dec >=20 > IntelFsp2Pkg/IntelFsp2Pkg.dec >=20 > IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec >=20 >=20 >=20 > [Pcd] >=20 > - gIntelFsp2WrapperTokenSpaceGuid.PcdFspmBaseAddress ## CONSUMES >=20 > - gIntelFsp2WrapperTokenSpaceGuid.PcdFspmUpdDataAddress ## CONSUMES >=20 > - gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection ## CONSUMES >=20 > + gIntelFsp2WrapperTokenSpaceGuid.PcdFspmBaseAddress ## CONSUMES >=20 > + gIntelFsp2WrapperTokenSpaceGuid.PcdFspmUpdDataAddress ## > CONSUMES >=20 > + gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection ## CONSUMES >=20 > + gIntelFsp2WrapperTokenSpaceGuid.PcdFsptBaseAddress ## CONSUMES >=20 > + gIntelFsp2WrapperTokenSpaceGuid.PcdFspMeasurementConfig ## > CONSUMES >=20 >=20 >=20 > [Sources] >=20 > FspmWrapperPeim.c >=20 > @@ -63,5 +68,10 @@ > gFspHobGuid ## PRODUCES ## HOB >=20 > gFspApiPerformanceGuid ## SOMETIMES_CONSUMES ## GUID >=20 >=20 >=20 > +[Ppis] >=20 > + gEdkiiTcgPpiGuid ## NOTIFY >=20 > + gEfiPeiFirmwareVolumeInfoMeasurementExcludedPpiGuid ## PRODUCES >=20 > + >=20 > [Depex] >=20 > - gEfiPeiMasterBootModePpiGuid >=20 > + gEfiPeiMasterBootModePpiGuid AND >=20 > + gPeiTpmInitializationDonePpiGuid >=20 > diff --git a/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c > b/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c > index b20f0805a0..688c82a6c8 100644 > --- a/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c > +++ b/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.c > @@ -3,7 +3,7 @@ > register TemporaryRamDonePpi to call TempRamExit API, and register > MemoryDiscoveredPpi >=20 > notify to call FspSiliconInit API. >=20 >=20 >=20 > - Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.
>=20 > + Copyright (c) 2014 - 2020, Intel Corporation. All rights reserved.
>=20 > SPDX-License-Identifier: BSD-2-Clause-Patent >=20 >=20 >=20 > **/ >=20 > @@ -24,12 +24,15 @@ > #include >=20 > #include >=20 > #include >=20 > +#include >=20 >=20 >=20 > #include >=20 > #include >=20 > #include >=20 > #include >=20 > #include >=20 > +#include >=20 > +#include >=20 > #include >=20 > #include >=20 > #include >=20 > @@ -379,7 +382,25 @@ FspsWrapperInitDispatchMode ( > VOID >=20 > ) >=20 > { >=20 > - EFI_STATUS Status; >=20 > + EFI_STATUS Status; >=20 > + EFI_PEI_FIRMWARE_VOLUME_INFO_MEASUREMENT_EXCLUDED_PPI > *MeasurementExcludedFvPpi; >=20 > + EFI_PEI_PPI_DESCRIPTOR *MeasurementExcl= udedPpiList; >=20 > + >=20 > + MeasurementExcludedFvPpi =3D AllocatePool > (sizeof(*MeasurementExcludedFvPpi)); >=20 > + ASSERT(MeasurementExcludedFvPpi !=3D NULL); >=20 > + MeasurementExcludedFvPpi->Count =3D 1; >=20 > + MeasurementExcludedFvPpi->Fv[0].FvBase =3D PcdGet32 (PcdFspsBaseAddres= s); >=20 > + MeasurementExcludedFvPpi->Fv[0].FvLength =3D > ((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 > (PcdFspsBaseAddress))->FvLength; >=20 > + >=20 > + MeasurementExcludedPpiList =3D AllocatePool > (sizeof(*MeasurementExcludedPpiList)); >=20 > + ASSERT(MeasurementExcludedPpiList !=3D NULL); >=20 > + MeasurementExcludedPpiList->Flags =3D EFI_PEI_PPI_DESCRIPTOR_PPI | > EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST; >=20 > + MeasurementExcludedPpiList->Guid =3D > &gEfiPeiFirmwareVolumeInfoMeasurementExcludedPpiGuid; >=20 > + MeasurementExcludedPpiList->Ppi =3D MeasurementExcludedFvPpi; >=20 > + >=20 > + Status =3D PeiServicesInstallPpi (MeasurementExcludedPpiList); >=20 > + ASSERT_EFI_ERROR (Status); >=20 > + >=20 > // >=20 > // FSP-S Wrapper running in Dispatch mode and reports FSP-S FV to PEI > dispatcher. >=20 > // >=20 > @@ -398,6 +419,72 @@ FspsWrapperInitDispatchMode ( > return Status; >=20 > } >=20 >=20 >=20 > +/** >=20 > + This function is called after TCG installed PPI. >=20 > + >=20 > + @param[in] PeiServices Pointer to PEI Services Table. >=20 > + @param[in] NotifyDesc Pointer to the descriptor for the Notificati= on event > that >=20 > + caused this function to execute. >=20 > + @param[in] Ppi Pointer to the PPI data associated with this= function. >=20 > + >=20 > + @retval EFI_STATUS Always return EFI_SUCCESS >=20 > +**/ >=20 > +EFI_STATUS >=20 > +EFIAPI >=20 > +TcgPpiNotify ( >=20 > + IN EFI_PEI_SERVICES **PeiServices, >=20 > + IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc, >=20 > + IN VOID *Ppi >=20 > + ); >=20 > + >=20 > +EFI_PEI_NOTIFY_DESCRIPTOR mTcgPpiNotifyDesc =3D { >=20 > + (EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | > EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST), >=20 > + &gEdkiiTcgPpiGuid, >=20 > + TcgPpiNotify >=20 > +}; >=20 > + >=20 > +/** >=20 > + This function is called after TCG installed PPI. >=20 > + >=20 > + @param[in] PeiServices Pointer to PEI Services Table. >=20 > + @param[in] NotifyDesc Pointer to the descriptor for the Notificati= on event > that >=20 > + caused this function to execute. >=20 > + @param[in] Ppi Pointer to the PPI data associated with this= function. >=20 > + >=20 > + @retval EFI_STATUS Always return EFI_SUCCESS >=20 > +**/ >=20 > +EFI_STATUS >=20 > +EFIAPI >=20 > +TcgPpiNotify ( >=20 > + IN EFI_PEI_SERVICES **PeiServices, >=20 > + IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDesc, >=20 > + IN VOID *Ppi >=20 > + ) >=20 > +{ >=20 > + UINT32 FspMeasureMask; >=20 > + FSP_INFO_HEADER *FspHeaderPtr; >=20 > + >=20 > + DEBUG ((DEBUG_INFO, "TcgPpiNotify FSPS\n")); >=20 > + >=20 > + FspMeasureMask =3D PcdGet32 (PcdFspMeasurementConfig); >=20 > + if ((FspMeasureMask & FSP_MEASURE_FSP) && (FspMeasureMask & > FSP_MEASURE_FSPS)) { >=20 > + if(FspMeasureMask & FSP_MEASURE_FSPUPD) { >=20 > + FspHeaderPtr =3D (FSP_INFO_HEADER *) FspFindFspHeader (PcdGet32 > (PcdFspsBaseAddress)); >=20 > + if (FspHeaderPtr =3D=3D NULL) { >=20 > + return EFI_DEVICE_ERROR; >=20 > + } >=20 > + MeasureFspFirmwareBlobWithCfg ("FSPS", PcdGet32(PcdFspsBaseAddress= ), >=20 > + (UINT32)((EFI_FIRMWARE_VOLUME_HEADE= R *) (UINTN) > PcdGet32 (PcdFspsBaseAddress))->FvLength, >=20 > + FspHeaderPtr->CfgRegionOffset, FspH= eaderPtr- > >CfgRegionSize); >=20 > + } else { >=20 > + MeasureFspFirmwareBlob (0, "FSPS", PcdGet32(PcdFspsBaseAddress), >=20 > + (UINT32)((EFI_FIRMWARE_VOLUME_HEADER *) (U= INTN) > PcdGet32 (PcdFspsBaseAddress))->FvLength); >=20 > + } >=20 > + } >=20 > + >=20 > + return EFI_SUCCESS; >=20 > +} >=20 > + >=20 > /** >=20 > This is the entrypoint of PEIM. >=20 >=20 >=20 > @@ -413,8 +500,13 @@ FspsWrapperPeimEntryPoint ( > IN CONST EFI_PEI_SERVICES **PeiServices >=20 > ) >=20 > { >=20 > + EFI_STATUS Status; >=20 > + >=20 > DEBUG ((DEBUG_INFO, "FspsWrapperPeimEntryPoint\n")); >=20 >=20 >=20 > + Status =3D PeiServicesNotifyPpi (&mTcgPpiNotifyDesc); >=20 > + ASSERT_EFI_ERROR (Status); >=20 > + >=20 > if (PcdGet8 (PcdFspModeSelection) =3D=3D 1) { >=20 > FspsWrapperInitApiMode (); >=20 > } else { >=20 > diff --git a/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.inf > b/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.inf > index 7da92991c8..884514747f 100644 > --- a/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.inf > +++ b/IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.inf > @@ -6,7 +6,7 @@ > # register TemporaryRamDonePpi to call TempRamExit API, and register > MemoryDiscoveredPpi >=20 > # notify to call FspSiliconInit API. >=20 > # >=20 > -# Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved. >=20 > +# Copyright (c) 2014 - 2020, Intel Corporation. All rights reserved. >=20 > # >=20 > # SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > # >=20 > @@ -44,24 +44,30 @@ > PerformanceLib >=20 > FspWrapperApiLib >=20 > FspWrapperApiTestLib >=20 > + FspMeasurementLib >=20 >=20 >=20 > [Packages] >=20 > MdePkg/MdePkg.dec >=20 > + MdeModulePkg/MdeModulePkg.dec >=20 > UefiCpuPkg/UefiCpuPkg.dec >=20 > + SecurityPkg/SecurityPkg.dec >=20 > IntelFsp2Pkg/IntelFsp2Pkg.dec >=20 > IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec >=20 >=20 >=20 > [Ppis] >=20 > - gTopOfTemporaryRamPpiGuid ## PRODUCES >=20 > - gFspSiliconInitDonePpiGuid ## PRODUCES >=20 > - gEfiEndOfPeiSignalPpiGuid ## PRODUCES >=20 > - gEfiTemporaryRamDonePpiGuid ## PRODUCES >=20 > - gEfiPeiMemoryDiscoveredPpiGuid ## NOTIFY >=20 > + gTopOfTemporaryRamPpiGuid ## PRODUCES >=20 > + gFspSiliconInitDonePpiGuid ## PRODUCES >=20 > + gEfiEndOfPeiSignalPpiGuid ## PRODUCES >=20 > + gEfiTemporaryRamDonePpiGuid ## PRODUCES >=20 > + gEfiPeiMemoryDiscoveredPpiGuid ## NOTIFY >=20 > + gEdkiiTcgPpiGuid ## NOTIFY >=20 > + gEfiPeiFirmwareVolumeInfoMeasurementExcludedPpiGuid ## PRODUCES >=20 >=20 >=20 > [Pcd] >=20 > - gIntelFsp2WrapperTokenSpaceGuid.PcdFspsBaseAddress ## CONSUMES >=20 > - gIntelFsp2WrapperTokenSpaceGuid.PcdFspsUpdDataAddress ## CONSUMES >=20 > - gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection ## CONSUMES >=20 > + gIntelFsp2WrapperTokenSpaceGuid.PcdFspsBaseAddress ## CONSUMES >=20 > + gIntelFsp2WrapperTokenSpaceGuid.PcdFspsUpdDataAddress ## CONSUMES >=20 > + gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection ## CONSUMES >=20 > + gIntelFsp2WrapperTokenSpaceGuid.PcdFspMeasurementConfig ## > CONSUMES >=20 >=20 >=20 > [Guids] >=20 > gFspHobGuid ## CONSUMES ## HOB >=20 > @@ -71,4 +77,5 @@ > FspsWrapperPeim.c >=20 >=20 >=20 > [Depex] >=20 > - gEfiPeiMemoryDiscoveredPpiGuid >=20 > + gEfiPeiMemoryDiscoveredPpiGuid AND >=20 > + gPeiTpmInitializationDonePpiGuid >=20 > -- > 2.26.2.windows.1