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.93; helo=mga11.intel.com; envelope-from=dandan.bi@intel.com; receiver=edk2-devel@lists.01.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (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 9E3102098C8C3 for ; Wed, 18 Jul 2018 23:44:17 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Jul 2018 23:44:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,373,1526367600"; d="scan'208";a="241485515" Received: from shwdeopenpsi114.ccr.corp.intel.com ([10.239.157.135]) by orsmga005.jf.intel.com with ESMTP; 18 Jul 2018 23:44:16 -0700 From: Dandan Bi To: edk2-devel@lists.01.org Cc: Liming Gao , Chao Zhang Date: Thu, 19 Jul 2018 14:44:02 +0800 Message-Id: <20180719064402.54872-2-dandan.bi@intel.com> X-Mailer: git-send-email 2.14.3.windows.1 In-Reply-To: <20180719064402.54872-1-dandan.bi@intel.com> References: <20180719064402.54872-1-dandan.bi@intel.com> Subject: [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: Thu, 19 Jul 2018 06:44:17 -0000 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/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; MeasuredHobData = NULL; + PERF_CALLBACK_BEGIN (&gEfiEndOfPeiSignalPpiGuid); + // // Create a Guid hob to save all measured Fv // MeasuredHobData = BuildGuidHob( &gMeasuredFvHobGuid, @@ -184,10 +186,12 @@ EndofPeiSignalNotifyCallBack ( // Save measured child Fv info // CopyMem (&MeasuredHobData->MeasuredFvBuf[mMeasuredBaseFvIndex] , mMeasuredChildFvInfo, sizeof(EFI_PLATFORM_FIRMWARE_BLOB) * (mMeasuredChildFvIndex)); } + PERF_CALLBACK_END (&gEfiEndOfPeiSignalPpiGuid); + return EFI_SUCCESS; } /** 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, EITHER EXPRESS OR IMPLIED. #include #include #include #include #include +#include BOOLEAN mImageInMemory = FALSE; EFI_PEI_PPI_DESCRIPTOR mTpmInitializedPpiList = { EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST, @@ -168,10 +169,12 @@ EndofPeiSignalNotifyCallBack ( { MEASURED_HOB_DATA *MeasuredHobData; MeasuredHobData = NULL; + PERF_CALLBACK_BEGIN (&gEfiEndOfPeiSignalPpiGuid); + // // Create a Guid hob to save all measured Fv // MeasuredHobData = BuildGuidHob( &gMeasuredFvHobGuid, @@ -193,10 +196,12 @@ EndofPeiSignalNotifyCallBack ( // Save measured child Fv info // CopyMem (&MeasuredHobData->MeasuredFvBuf[mMeasuredBaseFvIndex] , mMeasuredChildFvInfo, sizeof(EFI_PLATFORM_FIRMWARE_BLOB) * (mMeasuredChildFvIndex)); } + PERF_CALLBACK_END (&gEfiEndOfPeiSignalPpiGuid); + return EFI_SUCCESS; } /** Single function calculates SHA1 digest value for all raw data. It diff --git 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 [Guids] gTcgEventEntryHobGuid ## PRODUCES ## HOB gTpmErrorHobGuid ## SOMETIMES_PRODUCES ## HOB gMeasuredFvHobGuid ## PRODUCES ## HOB -- 2.14.3.windows.1