From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web12.58696.1597720538814391443 for ; Mon, 17 Aug 2020 20:15:38 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=crYyJPzr; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: chasel.chiu@intel.com) IronPort-SDR: dh0sQGewW2IY7DqwK6tvoxS9/1M7a/DKQiJ2XShBUxGLBfga5OWHwTnGK5HOLAK3I15Ggr7gZ6 Sj+dt326fQPQ== X-IronPort-AV: E=McAfee;i="6000,8403,9716"; a="154089961" X-IronPort-AV: E=Sophos;i="5.76,325,1592895600"; d="scan'208";a="154089961" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Aug 2020 20:15:37 -0700 IronPort-SDR: +87GxaAxTS/f+0PmKJ4ybj+oMiSGuUXB7SdLzoEnyregVT+L40KDTqgq2haM7EDACBP9Z8uLM3 QwMAsChj4mvQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,325,1592895600"; d="scan'208";a="296694019" Received: from fmsmsx602-2.cps.intel.com (HELO fmsmsx602.amr.corp.intel.com) ([10.18.84.212]) by orsmga006.jf.intel.com with ESMTP; 17 Aug 2020 20:15:37 -0700 Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 17 Aug 2020 20:15:37 -0700 Received: from fmsmsx103.amr.corp.intel.com (10.18.124.201) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Mon, 17 Aug 2020 20:15:37 -0700 Received: from FMSEDG002.ED.cps.intel.com (10.1.192.134) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 17 Aug 2020 20:15:36 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.172) by edgegateway.intel.com (192.55.55.69) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 17 Aug 2020 20:15:36 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P1//KaGlEyo9cqDjqowRtehO++guOHUoJP8NVqE1y9SoS658W96epKBXq9UtE2ypDEkgspJyGFXf2z4UZAf11LF1uPs9lORc1NJMGMIYwpsQasU9FJ2gAJD4G4BVmY9B7mHagYDt7KgTN0xiatyQ2sE+bI37B9gB4OTEwmWX1VXMV+QX4iU3/akzoUBV7W/b34TQodRJueBU4IauDB2ObvTia9B2MRV0YdhY33/cCfyo8M3+5eeDv9cLNLxAifN1Pt1weqetGTszWtwHAJO8sYPKVp4Jv1MRK3Cd8/Dc+6+oCtYUPWfQL6YHpMg70DcrKLCd67rGkmKQhMYVuZkJjw== 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=ZZIxBES17j3wyQDMrOdZHNTphSczaE3zr97SoGtX0bQ=; b=m7D9hO0CPYLLdNTH6cl59KHkaz7o0zyBHuRFPvNeNDEncIwcvV8oKDdbNckFLumpmXfAcWUa04iwaEV8J9QOJZa7HT8qS2jvNxyeu/NrC5etsJYgzYD9YCYENjGngWmbP0chuLrgWQyY5bHXlAviBhdiG4vn7TiUGZUT7SkoJbwKd1ZDu2+luAVDgs2DR8MjeXduQE3i4Rqfmx+65GZvigAjj3ddFJ7ptrYiLdV8G7jSyDHKYyDGCZnCEn2XNCBmciWzYbi5pgcNkLHkvldPg5idpPqqTn/oOVLwFFrdX8V13OveOniLz8HQEWx2a5ZptonMlo6NQ7aJvJx+zK005w== 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=ZZIxBES17j3wyQDMrOdZHNTphSczaE3zr97SoGtX0bQ=; b=crYyJPzruMIuXrI/sM6cqDqhGGhmx1LJS3ut+towXZN7ESLFPjmTXr2j2IwODqMhT/Fs1DpoD1kyInRQkMbGP1cWZyMxezaAQMI7ytKIdc3QBCQwB20YMwF3iFXUEdkitscvJ6cVx0eFB9NcnCXd1qk7tirueWk/eOMxwcJInOQ= Received: from SN6PR11MB2814.namprd11.prod.outlook.com (2603:10b6:805:55::15) by SA0PR11MB4576.namprd11.prod.outlook.com (2603:10b6:806:97::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3283.16; Tue, 18 Aug 2020 03:15:34 +0000 Received: from SN6PR11MB2814.namprd11.prod.outlook.com ([fe80::4843:7aba:799b:326]) by SN6PR11MB2814.namprd11.prod.outlook.com ([fe80::4843:7aba:799b:326%5]) with mapi id 15.20.3283.028; Tue, 18 Aug 2020 03:15:34 +0000 From: "Chiu, Chasel" To: "Zhang, Qi1" , "devel@edk2.groups.io" CC: "Yao, Jiewen" , "Desimone, Nathaniel L" , "Zeng, Star" Subject: Re: [PATCH v3 4/8] IntelFsp2WraperPkg/Fsp{m|s}WrapperPeim: Add FspBin measurement. Thread-Topic: [PATCH v3 4/8] IntelFsp2WraperPkg/Fsp{m|s}WrapperPeim: Add FspBin measurement. Thread-Index: AQHWcgSv5z/ulmL3FUeW9efyD4fF3Kk9N5tw Date: Tue, 18 Aug 2020 03:15:34 +0000 Message-ID: References: <20200814063159.2477-1-qi1.zhang@intel.com> <20200814063159.2477-5-qi1.zhang@intel.com> In-Reply-To: <20200814063159.2477-5-qi1.zhang@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 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: [61.60.205.141] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 0a04c566-de0f-4e52-aec4-08d84324f8f4 x-ms-traffictypediagnostic: SA0PR11MB4576: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 986w7+qp/byzuvswlA/T+QeQp5Nhwpp2GOa5hoMxmGSAehwMPdXrXwrLV5m85Z98AWAD+rsF3nFu2fqrG81YF5Yy5WBwyvHgV8omExpvG+eclf41IO6t3PDzhZQLVBOAVzA2y+1qdOgIT/aa+Lt9S7kE06VN1yh73hRNbPEt5YkL/kcL03fzkqT8Lh2qcAPZ5G8e1R9FGQyTNUI4UWdosbuzZx/JHWJCqYfWgEQbd3a0poxnB999d4KLA24l5JZNNUPBVyj5cMtDQgbwgnadrnS02G8EnmedvBbpFBoSBlZ6iglzVl29pJpzACO6trS1b+s0AtwAa5sngMl35ID3CbRu569kfQ0Wmxw8QDf2Px7tFvZ6wpQ18fAw3Mc20rVcJUkm0AegKROK2nr1g4EIFQ== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR11MB2814.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(396003)(39860400002)(136003)(366004)(376002)(346002)(4326008)(33656002)(8936002)(107886003)(2906002)(8676002)(110136005)(9686003)(26005)(5660300002)(55016002)(186003)(19627235002)(71200400001)(30864003)(66476007)(86362001)(966005)(76116006)(316002)(64756008)(83380400001)(53546011)(66446008)(66946007)(6506007)(54906003)(66556008)(52536014)(478600001)(7696005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: jqssG6+Nyue3I3Tim0MJpkNFw7HA58HqX7K9ZetAnJa4oQyKnwjkKO0N1aYCHb1klNBdveubzoPgAzGg13O52HGgvbwHHOCIySt92/KJZzER9vJuWeoPrzsJcMKTrlPPQc7cBNm23kSMVKAEA3dqDTNmoVmsgbxXUp9jFUI2xtGV+JoVRye55LVUq++j8pB6j4ST8Y/xk8hdAbua2UkQxeu5dgrLQgpk3FfUgLDi+G5B7vxHzklJaIb53LWCuax7RZH8M6BhK4jO/8akLl5pzdLmJNUkjfso0NMV9M816bGl/uEU96YjTsxO1wbkqVFeClxAmEWRQcZPRXqTSkh2eW2t18DT+6JUySrR7s13lsl4Dc2/DURxKHeae5j7Oo74IOolz7eGcd/1G3vP6E9e/DfmbFy6361ad1n2rpNnBn8K3yycexTGcEJ5rsPDO6XOI5slzTEBoDrZxxe3y52pN1MjEG5zAbF6FXoFhm4k4BhTWPMnFNAwX6zjl/gExm6iDTa7Ocqb2KiM0tfXBGYM/OHPzAwAl98sieU1jz5kfO9UxtOwV5I+U0kIYgibtxYCcTuLf2iJgcDxzIgT7t3FT17HZA+b0doaA+NhN2WdeVDmGi7olqF8V124rzfv/y7HDGGsSd8brTJpzMV351SdqQ== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB2814.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0a04c566-de0f-4e52-aec4-08d84324f8f4 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Aug 2020 03:15:34.6014 (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: vO6mVkbsOmAJKcYiPBTyFJ4AEFoLAdcH8xCXT77txLi5awfoonYI8SDNOW028kg7K6GqXW1yda9pN9hm1/S14Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR11MB4576 Return-Path: chasel.chiu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Chasel Chiu > -----Original Message----- > From: Zhang, Qi1 > Sent: Friday, August 14, 2020 2:32 PM > To: devel@edk2.groups.io > Cc: Yao, Jiewen ; Chiu, Chasel > ; Desimone, Nathaniel L > ; Zeng, Star ; Zhang= , > Qi1 > Subject: [PATCH v3 4/8] 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 | 90 > ++++++++++++++++++- > .../FspmWrapperPeim/FspmWrapperPeim.inf | 20 +++-- > .../FspsWrapperPeim/FspsWrapperPeim.c | 86 > +++++++++++++++++- > .../FspsWrapperPeim/FspsWrapperPeim.inf | 27 +++--- > 4 files changed, 204 insertions(+), 19 deletions(-) >=20 > diff --git a/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c > b/IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.c > index 265b77ed60..24ab534620 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 > *MeasurementExcludedPpiList; >=20 > + >=20 > + MeasurementExcludedFvPpi =3D AllocatePool > (sizeof(*MeasurementExcludedFvPpi)); >=20 > + ASSERT(MeasurementExcludedFvPpi !=3D NULL); >=20 > + MeasurementExcludedFvPpi->Count =3D 1; >=20 > + MeasurementExcludedFvPpi->Fv[0].FvBase =3D PcdGet32 > (PcdFspmBaseAddress); >=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,67 @@ 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 > Notification 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 > Notification 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 > + >=20 > + DEBUG ((DEBUG_INFO, "TcgPpiNotify FSPM\n")); >=20 > + >=20 > + FspMeasureMask =3D PcdGet32 (PcdFspMeasurementConfig); >=20 > + >=20 > + if ((FspMeasureMask & FSP_MEASURE_FSPT) !=3D 0) { >=20 > + MeasureFspFirmwareBlob (0, "FSPT", PcdGet32(PcdFsptBaseAddress), >=20 > + > (UINT32)((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 > (PcdFsptBaseAddress))->FvLength); >=20 > + } >=20 > + >=20 > + if ((FspMeasureMask & FSP_MEASURE_FSPM) !=3D 0) { >=20 > + MeasureFspFirmwareBlob (0, "FSPM", > PcdGet32(PcdFspmBaseAddress), >=20 > + > (UINT32)((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 > (PcdFspmBaseAddress))->FvLength); >=20 > + } >=20 > + >=20 > + return EFI_SUCCESS; >=20 > +} >=20 > + >=20 > /** >=20 > This is the entrypoint of PEIM >=20 >=20 >=20 > @@ -182,8 +263,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..9d4f279e81 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 > *MeasurementExcludedPpiList; >=20 > + >=20 > + MeasurementExcludedFvPpi =3D AllocatePool > (sizeof(*MeasurementExcludedFvPpi)); >=20 > + ASSERT(MeasurementExcludedFvPpi !=3D NULL); >=20 > + MeasurementExcludedFvPpi->Count =3D 1; >=20 > + MeasurementExcludedFvPpi->Fv[0].FvBase =3D PcdGet32 > (PcdFspsBaseAddress); >=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,62 @@ 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 > Notification 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 > Notification 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 > + >=20 > + DEBUG ((DEBUG_INFO, "TcgPpiNotify FSPS\n")); >=20 > + >=20 > + FspMeasureMask =3D PcdGet32 (PcdFspMeasurementConfig); >=20 > + >=20 > + if ((FspMeasureMask & FSP_MEASURE_FSPS) !=3D 0) { >=20 > + MeasureFspFirmwareBlob (0, "FSPS", PcdGet32(PcdFspsBaseAddress), >=20 > + > (UINT32)((EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) PcdGet32 > (PcdFspsBaseAddress))->FvLength); >=20 > + } >=20 > + >=20 > + return EFI_SUCCESS; >=20 > +} >=20 > + >=20 > /** >=20 > This is the entrypoint of PEIM. >=20 >=20 >=20 > @@ -413,8 +490,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