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.web11.5803.1596357944197987943 for ; Sun, 02 Aug 2020 01:45:44 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=Tj+D1fbD; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: jiewen.yao@intel.com) IronPort-SDR: zQyTgVOS2jenwhf1I771qY4lMpEhlRI4wiZJDLXQCGEVhj+0Ob48H5lgZrJnak5j2c/j1KU12G HDCo7KFEoOmw== X-IronPort-AV: E=McAfee;i="6000,8403,9700"; a="139942065" X-IronPort-AV: E=Sophos;i="5.75,425,1589266800"; d="scan'208";a="139942065" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Aug 2020 01:45:43 -0700 IronPort-SDR: O0FanPOONiYmMWjzfawNnjES1gUluhw0EmrUZ6+FVYbbGumtmMBW8i/6v5jmcwpSUZ98WPfQ6E 3LfO71pG5AWg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,425,1589266800"; d="scan'208";a="314322599" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by fmsmga004.fm.intel.com with ESMTP; 02 Aug 2020 01:45:43 -0700 Received: from fmsmsx604.amr.corp.intel.com (10.18.126.84) by fmsmsx604.amr.corp.intel.com (10.18.126.84) 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:45:43 -0700 Received: from fmsmsx151.amr.corp.intel.com (10.18.125.4) by fmsmsx604.amr.corp.intel.com (10.18.126.84) 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:45:43 -0700 Received: from FMSEDG001.ED.cps.intel.com (10.1.192.133) by FMSMSX151.amr.corp.intel.com (10.18.125.4) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 2 Aug 2020 01:45:42 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.170) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 2 Aug 2020 01:45:42 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l/RpyAyJG0x+bTZcDZCNP26pwgKDoZX1gAVVQvCD5EX+UPDE6zsbdTcRMnKBdtOKdgCA2FUmGsgkhnzQxGE0DWrl6m+aeB7rQVfqMnK1KtzSXyYiPvrmvOP+snFTnYg3BiSGz/x2trMFkZv0lbZNC0e8hmtaOweYOAVORXV8riimkm0MIDxHsnDNbdhav8F4QVuHSXp2vIllwSFGo0O32OWE7HETzc8W1wPFInfcgiipYm9flUhM1LyAwiLHKkda6lvSdt9tJ+Lf8l+QKlx50mfcOXiEJxdOzN6/oKwXefIqM9P/4VpG1rplAnWfRiB1NcVYpAtZxl095BJ/8lziDA== 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=wPVHg2ms5FS2EoqUPiGx9WihFFDkvt/a15BkBpKPCy4=; b=VkJAt40lXElS68U+VeI0nqnYe5UXu2vvcnHZRq3a9FaaGEhXQKsIbQt1EN7yQxparl2MrGvxTdqADkAVT8BOwnT1y7RF/0qvPdw0Vv/6uXzmLwr1Og8hmBVayFwT3x7W5oLWSUAuNvwGhzaRIJD55lFsUsJptGHhF3pmh9utd2pHegjKimA9Cd0qQ9DHDaWSherOj1uyHx6Z5I6H7NDTpdD7y5GVEs7e2CQtZydgWhv9b5cxLY0kCXQwXH1AZYHq1c61/u6FU6+yWsmTRcJvFPJJsF/c9JSrQ65lKR9RzeaNR40YsHKWlkxKdfYBr6J2+nStj/rqto+UD1Lc9ut/fw== 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=wPVHg2ms5FS2EoqUPiGx9WihFFDkvt/a15BkBpKPCy4=; b=Tj+D1fbDLK7NzkD/VkXhxfnVR6EZeLs9/uV+dekVMHkPGklNIGjn+Sg++2o0Tf0TXOskOHCB5gb+QUiliPpdNsnzdaqU6EnWfhafiYiK0ZsWmVDnn8xaWmP1nav+3FUXFbI4uuIhu8oHHRg3DVtPLSvykt/VNKYiUulptWtl1w8= 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:45:41 +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:45:41 +0000 From: "Yao, Jiewen" To: "Zhang, Qi1" , "devel@edk2.groups.io" CC: "Chiu, Chasel" , "Desimone, Nathaniel L" , "Zeng, Star" Subject: Re: [PATCH 6/9] IntelFsp2WrapperPkg/FspMeasurementLib: Add BaseFspMeasurementLib. Thread-Topic: [PATCH 6/9] IntelFsp2WrapperPkg/FspMeasurementLib: Add BaseFspMeasurementLib. Thread-Index: AQHWZxhM9jwTkgNh/0O7d+CM7DdZSKkkg8Ng Date: Sun, 2 Aug 2020 08:45:40 +0000 Message-ID: References: <20200731085437.16070-1-qi1.zhang@intel.com> <20200731085437.16070-7-qi1.zhang@intel.com> In-Reply-To: <20200731085437.16070-7-qi1.zhang@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZWYxYzY3YTUtZjI2MS00YzU1LThlYzYtM2FhOWMwNGViMTA5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoia0xEZzhEZXg0ZGFGOGd3MWNra0cyQmNvK3k5U2U2OWI5aE01SzdDOGZ5dmhqV3U1K3ZXVTU1TklhZnNIcUo5MiJ9 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: a2c38379-3e11-480b-4b47-08d836c06fde x-ms-traffictypediagnostic: CY4PR11MB1640: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6108; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: pSc3+KHAEyB62z2mBxKK3VTdB5ryHRRdYQK0rhG65SrEL1Gz8+d0ZPvdD1kQI38Q5r5W6HeladheAVKYi2ncvouxxItNEJ3Ko/VrjeabW4zDo+8UEtNEQAUAW5zqdb8XU8/Q+NglspTWD0H7ychRN4fOFVHeUjys3h2XrPC3R3ZLgh2ngYO8Y6ZHnO1YJy9TQKumn6Yu5MtHFzyWWLxlpLvKQqVXz3l7vsimMqSuZvQ02WMPlfz1W0rQA4zsQxATWyEf2LMkX49LmewL2IRGnLh4+neehYkneX40heXvizqaBUjJruD3PUhMx4VKzWlF92BmvcvYA+gTWB3GsG9/H9t6Qx55RTHxASGgD1eWtLSDFIgud2fKFyruWlnh2k2fyvlv06vSGDUxQR6cd8FiZw== 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)(316002)(5660300002)(83380400001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: CRQH9Z5Fb809znUcFpZOx3c8nz1BzVpt3e74qr/94oXlOgwRSnbNMjxv1zKk3Zb74bxar0Ffq9fvkk+B+y2/obP7mrKcpvbcXEudCJHWQNBbpfzsXLYiM6n7+bdk+36tZqFyUagk8wCrnuSVTJkDLPgrKYZ9fgnA7f/Ga8PePDl7272CU7nANbRYxLXOEc9hgogtMmY0Rz6fhi60TJBcJP/38E53opVvQxr2d6wPyK1Cr5Rf/xLlK0fZpEnX2QnFHjjcqWohkaAVpMKXCz9elXJRkU9wEhTFQLgo8H/b+ogo3JC/7K/zgoiZFbfUa3rO4DPFrFwHrXOpuSj/VZxluDSJzNT2alG9ofXUDGXaPvHJvYP/3naECK7uOb5+sIw7P4mlcVbrVEK08UJfLxaYaNLqPUigXsIqLWj2aihE5Eir1ibB/D7GZ7uoAz35+FwUfNGY08V/iQ2H9p1wAYiuLi7NzL1po7BCoEpdTp4IPKFC5TaKPNRoyMI4lCAYi+Tvf464F6V6ngwpTcCTcjR3C5ehAM1EuyL9z0+10Hjqfm9GVLaoKqsaHshYBSk37SAsiYPW7hArvgv1Yf1GzVx1UQoRXRVOyORzkZ9dvA4Bn0C2NYD/zQ+mdkEnjo2myUDT/6nEG+Jz8/in8heH8lZVIQ== 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: a2c38379-3e11-480b-4b47-08d836c06fde X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Aug 2020 08:45:40.9845 (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: xHIEuixumQ5dBvuMS7WHh18FSClul9quX0aj26aqY7T97pFFHh+YRSUY3KT+yV3P4cYzYqq5fJyT1ibhcDeUjA== 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 implement MeasureFspFirmwareBlobWithCfg() directly here.=20 MeasureFspFirmwareBlobWithCfg () should be an internal function. MeasureFspFirmwareBlob() may call MeasureFspFirmwareBlobWithCfg() based upo= n PCD. MeasureFirmwareBlobWithCfg() should not be used because it should not exist= . 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 6/9] IntelFsp2WrapperPkg/FspMeasurementLib: Add > BaseFspMeasurementLib. >=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 > --- > .../BaseFspMeasurementLib.inf | 37 ++++++++++ > .../BaseFspMeasurementLib/FspMeasurementLib.c | 70 +++++++++++++++++++ > 2 files changed, 107 insertions(+) > create mode 100644 > IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/BaseFspMeasurementLi > b.inf > create mode 100644 > IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/FspMeasurementLib.c >=20 > diff --git > a/IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/BaseFspMeasurement > Lib.inf > b/IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/BaseFspMeasurement > Lib.inf > new file mode 100644 > index 0000000000..2539164e40 > --- /dev/null > +++ > b/IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/BaseFspMeasurement > Lib.inf > @@ -0,0 +1,37 @@ > +## @file >=20 > +# Provides FSP measurement functions. >=20 > +# >=20 > +# This library provides MeasureFspFirmwareBlob() to measure FSP binary. >=20 > +# >=20 > +# Copyright (c) 2020, Intel Corporation. All rights reserved.
>=20 > +# SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > +# >=20 > +## >=20 > + >=20 > +[Defines] >=20 > + INF_VERSION =3D 0x00010005 >=20 > + BASE_NAME =3D FspMeasurementLib >=20 > + FILE_GUID =3D 9A62C49D-C45A-4322-9F3C-45958DF0056= B >=20 > + MODULE_TYPE =3D BASE >=20 > + VERSION_STRING =3D 1.0 >=20 > + LIBRARY_CLASS =3D FspMeasurementLib >=20 > + >=20 > +# >=20 > +# The following information is for reference only and not required by th= e build > tools. >=20 > +# >=20 > +# VALID_ARCHITECTURES =3D IA32 X64 >=20 > +# >=20 > + >=20 > +[Sources] >=20 > + FspMeasurementLib.c >=20 > + >=20 > +[Packages] >=20 > + MdePkg/MdePkg.dec >=20 > + MdeModulePkg/MdeModulePkg.dec >=20 > + IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec >=20 > + >=20 > +[LibraryClasses] >=20 > + BaseLib >=20 > + BaseMemoryLib >=20 > + DebugLib >=20 > + TpmMeasurementLib >=20 > diff --git > a/IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/FspMeasurementLib.c > b/IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/FspMeasurementLib.c > new file mode 100644 > index 0000000000..8a33fe97c0 > --- /dev/null > +++ > b/IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/FspMeasurementLib.c > @@ -0,0 +1,70 @@ > +/** @file >=20 > + This library is used by FSP modules to measure data to TPM. >=20 > + >=20 > +Copyright (c) 2020, Intel Corporation. All rights reserved.
>=20 > +SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > + >=20 > +**/ >=20 > + >=20 > +#include >=20 > + >=20 > +#include >=20 > +#include >=20 > +#include >=20 > +#include >=20 > + >=20 > +#include >=20 > + >=20 > +/** >=20 > + Mesure a FSP FirmwareBlob. >=20 > + >=20 > + @param[in] PcrIndex PCR Index. >=20 > + @param[in] Descrption Description for this FirmwareBlob. >=20 > + @param[in] FirmwareBlobBase Base address of this FirmwareBlob. >=20 > + @param[in] FirmwareBlobLength Size in bytes of this FirmwareBlob= . >=20 > + >=20 > + @retval EFI_SUCCESS Operation completed successfully. >=20 > + @retval EFI_UNSUPPORTED TPM device not available. >=20 > + @retval EFI_OUT_OF_RESOURCES Out of memory. >=20 > + @retval EFI_DEVICE_ERROR The operation was unsuccessful. >=20 > +*/ >=20 > +EFI_STATUS >=20 > +EFIAPI >=20 > +MeasureFspFirmwareBlob ( >=20 > + IN UINT32 PcrIndex, >=20 > + IN CHAR8 *Description OPTIONAL, >=20 > + IN EFI_PHYSICAL_ADDRESS FirmwareBlobBase, >=20 > + IN UINT64 FirmwareBlobLength >=20 > + ) >=20 > +{ >=20 > + return MeasureFirmwareBlob (PcrIndex, Description, FirmwareBlobBase, > FirmwareBlobLength); >=20 > +} >=20 > + >=20 > +/** >=20 > + Mesure a FSP FirmwareBlob. >=20 > + >=20 > + @param[in] Descrption Description for this FirmwareBlob. >=20 > + @param[in] FirmwareBlobBase Base address of this FirmwareBlob. >=20 > + @param[in] FirmwareBlobLength Size in bytes of this FirmwareBlob= . >=20 > + @param[in] CfgRegionOffset Configuration region offset in byt= es. >=20 > + @param[in] CfgRegionSize Configuration region in bytes. >=20 > + >=20 > + @retval EFI_SUCCESS Operation completed successfully. >=20 > + @retval EFI_UNSUPPORTED TPM device not available. >=20 > + @retval EFI_OUT_OF_RESOURCES Out of memory. >=20 > + @retval EFI_DEVICE_ERROR The operation was unsuccessful. >=20 > +*/ >=20 > +EFI_STATUS >=20 > +EFIAPI >=20 > +MeasureFspFirmwareBlobWithCfg ( >=20 > + IN CHAR8 *Description OPTIONAL, >=20 > + IN EFI_PHYSICAL_ADDRESS FirmwareBlobBase, >=20 > + IN UINT64 FirmwareBlobLength, >=20 > + IN UINT32 CfgRegionOffset, >=20 > + IN UINT32 CfgRegionSize >=20 > + ) >=20 > +{ >=20 > + return MeasureFirmwareBlobWithCfg (Description, FirmwareBlobBase, > FirmwareBlobLength, CfgRegionOffset, CfgRegionSize); >=20 > + >=20 > +} >=20 > + >=20 > -- > 2.26.2.windows.1