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.43; helo=mga05.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 B7DAA210C1EE7 for ; Wed, 25 Jul 2018 07:08:04 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Jul 2018 07:08:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,401,1526367600"; d="scan'208";a="57075418" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga007.fm.intel.com with ESMTP; 25 Jul 2018 07:07:57 -0700 Received: from fmsmsx158.amr.corp.intel.com (10.18.116.75) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 25 Jul 2018 07:07:57 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx158.amr.corp.intel.com (10.18.116.75) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 25 Jul 2018 07:07:57 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.81]) by shsmsx102.ccr.corp.intel.com ([169.254.2.124]) with mapi id 14.03.0319.002; Wed, 25 Jul 2018 22:07:55 +0800 From: "Gao, Liming" To: "Bi, Dandan" , "edk2-devel@lists.01.org" CC: "Zhang, Chao B" Thread-Topic: [patch 2/2] SecurityPkg/Tcg: Add use case for new Perf macro Thread-Index: AQHUHyv5oeZgnbRfsEa4ABwqZGdDT6SgA2Mg Date: Wed, 25 Jul 2018 14:07:54 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E2C0D89@SHSMSX104.ccr.corp.intel.com> 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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYzc3OGJlZmItYzc5YS00MWZmLWExYTEtNzBhNGFiNDFkMThlIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoidUdSeFl4Z3M5cm1YdUpqR3RWU1wvUEtGSjJ0aVwvT2xvRlI5ZWNHZHBGRlFLbjJqdGlqOFNpS3lSWHB0OHJwamo0In0= 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: Wed, 25 Jul 2018 14:08:04 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao > -----Original Message----- > From: Bi, Dandan > 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 >=20 > Add an example case for the usage of > PERF_CALLBACK_BEGIN/PERF_CALLBACK_END >=20 > 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(+) >=20 > diff --git a/SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c b/SecurityPkg/Tcg/Tcg2Pei/= Tcg2Pei.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 @@ EndofPeiSignalNotifyCallBack ( > // Save measured child Fv info > // > CopyMem (&MeasuredHobData->MeasuredFvBuf[mMeasuredBaseFvIndex] , mMe= asuredChildFvInfo, > sizeof(EFI_PLATFORM_FIRMWARE_BLOB) * (mMeasuredChildFvIndex)); > } >=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/Tcg= Pei.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, EI= THER 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 @@ EndofPeiSignalNotifyCallBack ( > // Save measured child Fv info > // > CopyMem (&MeasuredHobData->MeasuredFvBuf[mMeasuredBaseFvIndex] , mMe= asuredChildFvInfo, > sizeof(EFI_PLATFORM_FIRMWARE_BLOB) * (mMeasuredChildFvIndex)); > } >=20 > + PERF_CALLBACK_END (&gEfiEndOfPeiSignalPpiGuid); > + > return EFI_SUCCESS; > } >=20 > /** > Single function calculates SHA1 digest value for all raw data. It > diff --git a/SecurityPkg/Tcg/TcgPei/TcgPei.inf b/SecurityPkg/Tcg/TcgPei/T= cgPei.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 ##= PRODUCES ## HOB > gTpmErrorHobGuid ##= SOMETIMES_PRODUCES ## HOB > gMeasuredFvHobGuid ##= PRODUCES ## HOB > -- > 2.14.3.windows.1