From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web11.18821.1597163146052924710 for ; Tue, 11 Aug 2020 09:25:46 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=MwuZkTL7; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: jian.j.wang@intel.com) IronPort-SDR: Q23bzch1mE4nUa41Efl5z3724//2Qr04s4V/HtPBKtbSe0fz2iLDroTET1Upo19QBBVaLPLsSl zXRVTldmAHrQ== X-IronPort-AV: E=McAfee;i="6000,8403,9710"; a="141377636" X-IronPort-AV: E=Sophos;i="5.76,301,1592895600"; d="scan'208";a="141377636" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Aug 2020 09:25:45 -0700 IronPort-SDR: Xd1Ec9mPplRAUZDC5Ep4Kjoo7e4cVdqAEhDSqHSrHn8tAMYWskOd8bCrJMHANLAjLqBQXS6iae SqKjCw2gNL6Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,301,1592895600"; d="scan'208";a="308449140" Received: from unknown (HELO fmsmsx604.amr.corp.intel.com) ([10.18.84.214]) by orsmga002.jf.intel.com with ESMTP; 11 Aug 2020 09:25:45 -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; Tue, 11 Aug 2020 09:25:44 -0700 Received: from fmsmsx124.amr.corp.intel.com (10.18.125.39) 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; Tue, 11 Aug 2020 09:25:44 -0700 Received: from FMSEDG002.ED.cps.intel.com (10.1.192.134) by fmsmsx124.amr.corp.intel.com (10.18.125.39) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 11 Aug 2020 09:25:43 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.105) by edgegateway.intel.com (192.55.55.69) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 11 Aug 2020 09:25:40 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q8IgAXzsZETHtBZ1s9XhNHAwXzvEjEGf+gmPI/apzwY0Y5zn7G3AvTH1qYAlZWnOiglQJOGJq2+YeQFN8H7DiRLo+3bVm5HNyhM1AS4r7mlVLGc9zcCFUjz+5yHQa8mDJxBm0xiRWkS5Z0At8/DzCb6HvMD+pJFHGq7y2cFGlrG/6PP4IodWQPH1zUfZ+g9nmJk33z3GDyiVdVVryCUlNq7rBmAPpPmDZToBtqBX4ywW73xB0256qS157sMt4RFBGr2mTmiTTWFXTo/83bIXwwRuxtyYFaqt2U0egQqYQwQ8U8mR3cvGC96QpwKc3rX6vtST1yMT6UKKtEyJoz8Agg== 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=8LONFISyxqKwq0+23GW8vndvVH/6jMbRq6HA9dXzajk=; b=fspASoNnWt3qmhp+t+ANg+r8/auz4zLMe4ReQhR+xR74bZ2wxMWjaBQo9HAyKIbNZAogTYlhf3UW2+lmlT5dSBFP60I0ZRpFNEmFFgZYwbN5RazpzJfio6XermS67yZqYQjy9nNrrmuspNHhz2zwT2UQyYmUBPst63B9dCppufHn+ZnCQHJ6WYOTLXg2TBOHKg0PbZlRIyEE9OQ2vyKe+fRubuwstZ03p4NgNWO0ZshvFU47OzFGZqHH4glDU48Iik31fThMtzIOMd0cs/XxExYddrA41UbXcQ+V1PIXrPqhzx2uFtklE0rdcUhpWOpn81aVzs5H3yHIu0e1W2tT2w== 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=8LONFISyxqKwq0+23GW8vndvVH/6jMbRq6HA9dXzajk=; b=MwuZkTL7JGIHM3EsiEKKiMgGPsEAPKQnYvlvgltBSoAy5Ikx4F+qeYZeMZxLkIq0R2clBxuMRJfcBdapjS5EXqQPTnavg2z3mx7yxu3bgiz4jKeCkh1g/y33KLJf456FDFZDcQXfQApIEK2UuNxJ6zZAObMXPt08Dqn+yD6RRKg= Received: from SN6PR11MB3312.namprd11.prod.outlook.com (2603:10b6:805:c8::14) by SA0PR11MB4672.namprd11.prod.outlook.com (2603:10b6:806:96::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3261.15; Tue, 11 Aug 2020 16:25:38 +0000 Received: from SN6PR11MB3312.namprd11.prod.outlook.com ([fe80::bc48:4db0:9666:124e]) by SN6PR11MB3312.namprd11.prod.outlook.com ([fe80::bc48:4db0:9666:124e%7]) with mapi id 15.20.3261.024; Tue, 11 Aug 2020 16:25:38 +0000 From: "Wang, Jian J" To: "Zhang, Qi1" , "devel@edk2.groups.io" CC: "Yao, Jiewen" , "Wu, Hao A" , "Chiu, Chasel" , "Desimone, Nathaniel L" , "Zeng, Star" Subject: Re: [PATCH v2 0/9] Need add a FSP binary measurement Thread-Topic: [PATCH v2 0/9] Need add a FSP binary measurement Thread-Index: AQHWa4lCUH4aYNRc+U2uhVp9utbUrakzHFxA Date: Tue, 11 Aug 2020 16:25:38 +0000 Message-ID: References: <20200806003342.17866-1-qi1.zhang@intel.com> In-Reply-To: <20200806003342.17866-1-qi1.zhang@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNjAyMDg1OTEtYmY3YS00MTRjLTlkZmYtZTY5Y2E0NGIzMjdjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiMHVLRGhaWWczenM0cDFmR1JyM0tER0I4QkF1V2EzY01IVXdLUGppSzZ2cERZdHZHRnBoRmdcL2owaUdcLzRUZXNEIn0= dlp-reaction: no-action dlp-version: 11.5.1.3 dlp-product: dlpe-windows x-ctpclassification: CTP_NT 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: [180.158.56.57] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 1cd36196-a5b4-4018-d0eb-08d83e132f0d x-ms-traffictypediagnostic: SA0PR11MB4672: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5516; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: nb4O8bHNfjXWC3CuZAoNR/9dLetobIr0Mtrdp4mfsne+L44EevH7BLSvT03IWq2tXOKZIzvH3ZaUZfJLPaSIrTJ/feu6xykZo4Zhnc9F7GEpo7SC9ZsL/M63Sg9Li1aMWepkIPdwaL6x3XoCvwYUtvmz49ooR111OLPL3GF+39+tLhEDIa27h09cFyBbrPLgc5sX1ymVc+bXspllonBJ2FX5i2XDlIUAR6Uw/SFqkGHdbvdKHOPF4Wesboj49Dogmn+QE5oZ41LO9wbubjJO3Lq7IA5yhw7i38WQX7GfZsz4a0RuEisP7iscSIRcT7vBV4vPcJPg8n8esaPOpV5RduybGUKcE4QvUQF5SNeDOM366XxYYc79Z/SvdV/JE8nDmMDvm35VG7gvZOcPlH2Axw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR11MB3312.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(396003)(366004)(39860400002)(346002)(376002)(136003)(966005)(8936002)(64756008)(52536014)(33656002)(4326008)(76116006)(66946007)(66476007)(53546011)(26005)(66556008)(6506007)(186003)(66446008)(8676002)(5660300002)(478600001)(2906002)(54906003)(83380400001)(19627235002)(110136005)(71200400001)(55016002)(86362001)(316002)(9686003)(107886003)(7696005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: 79fZACujdb4u8EzH+TGkfeoWN0mhXts1BlX8TvrtJPCIZX0SN70z2e4hvwV1kbia19pj5OzPlrtPjcHoCVoML7Hw/9HInxp5chTF5w2iOvCCklAhO57n+DL5Av1AGQTD42EKolDrJZ5EnxlurYscf8goHg5FBHn5+3TZ+vAjkqB5ASL/VE9YIeW2AEX29PfzH3SjCQ8In4BTINJvtEsDNy1FBxeP7IvPJRHphN/OFcQSjyoa2NC3hRvbeGswYg3BcgI2NQpAED2vynpzQFz7Qgn7G9X+t5dgB1lC699373OwkzLbafx0A71FkhJ0phXw5V+4580qH+x+eiQE4yycLVuDysFQ3Got/4G9FozMyeyVp4JNIGELDFFpAYQ0h9JO4M00TqkG+v4QfEQUHVU/+gTPCwDl8DGCN8Mdj7MCveHAn2fl00MvFGDDx0Qi6pVSfsB+ZCRLpNicdlofvpeCGRBTyo5RwdEXwuf9PuDfYDY50IOm7/BjqKd0vg+ZAaxkHaGhJkr1ATWk1gOwQzDlaAOOaeo2ZRDzo6A3iI1IxnWqH1i/Ofiz4XSZIz9vO8JCo4XqbieyV+n5u4YivpxzZ3qRgkVB4GGphg9wPK7Gj7fkPUP1ZmIspOW0qXr32yp+pl2JKUKxpzBi2ZIFiozA0A== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB3312.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1cd36196-a5b4-4018-d0eb-08d83e132f0d X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Aug 2020 16:25:38.5771 (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: RwAgG7NF0UmJ8Ag9uw/TrS3iA+9IvnuQc1iz6KsoG2kVPXU5LgAmay4Px4x+/3D0eNC8maxM3ZtSbbtiPL2MUQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR11MB4672 Return-Path: jian.j.wang@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Qi, Two common comments here. More specific comments will be given separately in each patch email later. c1. SecurityPkg/Library/DxeTpmMeasurementLib/EventLogRecord.c and=20 SecurityPkg/Library/PeiTpmMeasurementLib/EventLogRecord.c are almost the same. Consider consolidating the code in some way, like a shared = lib or shared folder. c2. TpmMeasurementGetFvName() or similar is duplicated in at least four pla= ces: DxeTpmMeasurementLib, PeiTpmMeasurementLib, BaseFspMeasurementLib and Tcg2Pei. Consider consolidate the code. Regards, Jian > -----Original Message----- > From: Zhang, Qi1 > Sent: Thursday, August 06, 2020 8:34 AM > To: devel@edk2.groups.io > Cc: Zhang, Qi1 ; Yao, Jiewen ; > Wang, Jian J ; Wu, Hao A ; Chi= u, > Chasel ; Desimone, Nathaniel L > ; Zeng, Star > Subject: [PATCH v2 0/9] Need add a FSP binary measurement >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2376 >=20 > The EDKII BIOS calls FSP API in FSP Wrapper Pkg. > This FSP code need to be measured into TPM. >=20 > We need add a generic module in FSP Wrapper Pkg code to measure: > 1) FSP-T, FSP-M, FSP-S in API mode. > 2) FSP-T in Dispatch-mode. The FSP-M and FSP-S will be reported > as standard FV and they will be measured by TCG-PEI. >=20 > Cc: Jiewen Yao > Cc: Jian J Wang > Cc: Hao A Wu > Cc: Chasel Chiu > Cc: Nate DeSimone > Cc: Star Zeng > Cc: Qi Zhang >=20 > Jiewen Yao (8): > MdeModulePkg/TpmMeasurementLib: Add new API to TpmMeasurmentLib. > MdeModulePkg/NullTpmMeasurementLib: Add new API. > SecurityPkg/DxeTpmMeasurementLib: Add new API. > SecurityPkg/PeiTpmMeasurementLib: Add new API. > IntelFsp2WrapperPkg/FspMeasurementLib: Add header file. > IntelFsp2WrapperPkg/FspMeasurementLib: Add BaseFspMeasurementLib. > IntelFsp2WraperPkg/Fsp{m|s}WrapperPeim: Add FspBin measurement. > IntelFsp2Wrapper/dsc: Add FspTpmMeasurementLib and > PcdFspMeasurementConfig. >=20 > Qi Zhang (1): > SecurityPkg/Tcg2: handle PRE HASH and LOG ONLY >=20 > .../FspmWrapperPeim/FspmWrapperPeim.c | 90 ++++- > .../FspmWrapperPeim/FspmWrapperPeim.inf | 20 +- > .../FspsWrapperPeim/FspsWrapperPeim.c | 85 ++++- > .../FspsWrapperPeim/FspsWrapperPeim.inf | 27 +- > .../Include/Library/FspMeasurementLib.h | 39 ++ > IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec | 17 + > IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc | 5 +- > .../BaseFspMeasurementLib.inf | 54 +++ > .../BaseFspMeasurementLib/FspMeasurementLib.c | 349 ++++++++++++++++++ > .../Include/Library/TpmMeasurementLib.h | 48 ++- > .../TpmMeasurementLibNull.c | 61 ++- > .../TpmMeasurementLibNull.inf | 6 +- > SecurityPkg/Include/Ppi/Tcg.h | 5 + > .../DxeTpmMeasurementLib.inf | 6 +- > .../DxeTpmMeasurementLib/EventLogRecord.c | 218 +++++++++++ > .../PeiTpmMeasurementLib/EventLogRecord.c | 218 +++++++++++ > .../PeiTpmMeasurementLib.inf | 4 + > SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c | 12 +- > 18 files changed, 1233 insertions(+), 31 deletions(-) > create mode 100644 > IntelFsp2WrapperPkg/Include/Library/FspMeasurementLib.h > create mode 100644 > IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/BaseFspMeasurementLi > b.inf > create mode 100644 > IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/FspMeasurementLib.c > create mode 100644 > SecurityPkg/Library/DxeTpmMeasurementLib/EventLogRecord.c > create mode 100644 > SecurityPkg/Library/PeiTpmMeasurementLib/EventLogRecord.c >=20 > -- > 2.26.2.windows.1