From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.115; helo=mga14.intel.com; envelope-from=chao.b.zhang@intel.com; receiver=edk2-devel@lists.01.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 1F5DE210C0F66 for ; Mon, 23 Jul 2018 22:10:02 -0700 (PDT) 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/DHE-RSA-AES256-GCM-SHA384; 23 Jul 2018 22:10:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,396,1526367600"; d="scan'208";a="60134212" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga006.jf.intel.com with ESMTP; 23 Jul 2018 22:09:54 -0700 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 23 Jul 2018 22:09:43 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 23 Jul 2018 22:09:42 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.57]) by shsmsx102.ccr.corp.intel.com ([169.254.2.124]) with mapi id 14.03.0319.002; Tue, 24 Jul 2018 13:09:40 +0800 From: "Zhang, Chao B" To: "Bi, Dandan" , "edk2-devel@lists.01.org" CC: "Gao, Liming" Thread-Topic: [patch 2/2] SecurityPkg/Tcg: Add use case for new Perf macro Thread-Index: AQHUHyv58brbEEw3fkSEhfd3WNdlJqSd2gbA Date: Tue, 24 Jul 2018 05:09:40 +0000 Message-ID: References: <20180719064402.54872-1-dandan.bi@intel.com> <20180719064402.54872-2-dandan.bi@intel.com> In-Reply-To: <20180719064402.54872-2-dandan.bi@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMGUyNzAxNDktMmEzOC00Mzc1LTgzNzUtNGE4MDhiNjhjMzcyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiQjl3S0RHUXdvdDJwZ212OUM0MjFqeVZBRVVjOVZVUW4rUncyZkErZGdibkNETkREUVwvU0RzbDZLN1ZFZ1pYWGwifQ== dlp-product: dlpe-windows dlp-version: 11.0.200.100 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [patch 2/2] SecurityPkg/Tcg: Add use case for new Perf macro X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jul 2018 05:10:03 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Chao Zhang -----Original Message----- From: Bi, Dandan=20 Sent: Thursday, July 19, 2018 2:44 PM To: edk2-devel@lists.01.org Cc: Gao, Liming ; Zhang, Chao B Subject: [patch 2/2] SecurityPkg/Tcg: Add use case for new Perf macro Add an example case for the usage of PERF_CALLBACK_BEGIN/PERF_CALLBACK_END Cc: Liming Gao Cc: Chao Zhang Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi --- SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c | 4 ++++ SecurityPkg/Tcg/TcgPei/TcgPei.c | 5 +++++ SecurityPkg/Tcg/TcgPei/TcgPei.inf | 1 + 3 files changed, 10 insertions(+) diff --git a/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c b/SecurityPkg/Tcg/Tcg2Pei/Tc= g2Pei.c index 74cdd1fa88..09ef0c70a5 100644 --- a/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c +++ b/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c @@ -159,10 +159,12 @@ EndofPeiSignalNotifyCallBack ( { MEASURED_HOB_DATA *MeasuredHobData; =20 MeasuredHobData =3D NULL; =20 + PERF_CALLBACK_BEGIN (&gEfiEndOfPeiSignalPpiGuid); + // // Create a Guid hob to save all measured Fv // MeasuredHobData =3D BuildGuidHob( &gMeasuredFvHobGuid, @@ -184,10 +186,12 @@ EndofPeiS= ignalNotifyCallBack ( // Save measured child Fv info // CopyMem (&MeasuredHobData->MeasuredFvBuf[mMeasuredBaseFvIndex] , mMeas= uredChildFvInfo, sizeof(EFI_PLATFORM_FIRMWARE_BLOB) * (mMeasuredChildFvInde= x)); } =20 + PERF_CALLBACK_END (&gEfiEndOfPeiSignalPpiGuid); + return EFI_SUCCESS; } =20 /** Make sure that the current PCR allocations, the TPM supported PCRs, diff= --git a/SecurityPkg/Tcg/TcgPei/TcgPei.c b/SecurityPkg/Tcg/TcgPei/TcgPei.c = index 1ed11a1b29..d07047580c 100644 --- a/SecurityPkg/Tcg/TcgPei/TcgPei.c +++ b/SecurityPkg/Tcg/TcgPei/TcgPei.c @@ -39,10 +39,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITH= ER EXPRESS OR IMPLIED. #include #include #include #include #include +#include =20 BOOLEAN mImageInMemory =3D FALSE; =20 EFI_PEI_PPI_DESCRIPTOR mTpmInitializedPpiList =3D { EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST, @@ -168,10 +169,12 @@ EndofPeiSignalNotifyCallBack ( { MEASURED_HOB_DATA *MeasuredHobData; =20 MeasuredHobData =3D NULL; =20 + PERF_CALLBACK_BEGIN (&gEfiEndOfPeiSignalPpiGuid); + // // Create a Guid hob to save all measured Fv // MeasuredHobData =3D BuildGuidHob( &gMeasuredFvHobGuid, @@ -193,10 +196,12 @@ EndofPeiS= ignalNotifyCallBack ( // Save measured child Fv info // CopyMem (&MeasuredHobData->MeasuredFvBuf[mMeasuredBaseFvIndex] , mMeas= uredChildFvInfo, sizeof(EFI_PLATFORM_FIRMWARE_BLOB) * (mMeasuredChildFvInde= x)); } =20 + PERF_CALLBACK_END (&gEfiEndOfPeiSignalPpiGuid); + return EFI_SUCCESS; } =20 /** Single function calculates SHA1 digest value for all raw data. It diff --g= it a/SecurityPkg/Tcg/TcgPei/TcgPei.inf b/SecurityPkg/Tcg/TcgPei/TcgPei.inf index 0252511391..4c8a055c6c 100644 --- a/SecurityPkg/Tcg/TcgPei/TcgPei.inf +++ b/SecurityPkg/Tcg/TcgPei/TcgPei.inf @@ -54,10 +54,11 @@ BaseLib PcdLib MemoryAllocationLib ReportStatusCodeLib Tpm12CommandLib + PerformanceLib =20 [Guids] gTcgEventEntryHobGuid ## P= RODUCES ## HOB gTpmErrorHobGuid ## S= OMETIMES_PRODUCES ## HOB gMeasuredFvHobGuid ## P= RODUCES ## HOB -- 2.14.3.windows.1