public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Gao, Liming" <liming.gao@intel.com>
To: "Bi, Dandan" <dandan.bi@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Zhang, Chao B" <chao.b.zhang@intel.com>
Subject: Re: [patch 2/2] SecurityPkg/Tcg: Add use case for new Perf macro
Date: Wed, 25 Jul 2018 14:07:54 +0000	[thread overview]
Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E2C0D89@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <20180719064402.54872-2-dandan.bi@intel.com>

Reviewed-by: Liming Gao <liming.gao@intel.com>

> -----Original Message-----
> From: Bi, Dandan
> Sent: Thursday, July 19, 2018 2:44 PM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming <liming.gao@intel.com>; Zhang, Chao B <chao.b.zhang@intel.com>
> 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 <liming.gao@intel.com>
> Cc: Chao Zhang <chao.b.zhang@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Dandan Bi <dandan.bi@intel.com>
> ---
>  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 <Library/MemoryAllocationLib.h>
>  #include <Library/ReportStatusCodeLib.h>
>  #include <Library/Tpm12DeviceLib.h>
>  #include <Library/Tpm12CommandLib.h>
>  #include <Library/BaseCryptLib.h>
> +#include <Library/PerformanceLib.h>
> 
>  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



  parent reply	other threads:[~2018-07-25 14:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-19  6:44 [patch 1/2] MdeModulePkg/DxeLoadFunc: Add use case for new Perf macro Dandan Bi
2018-07-19  6:44 ` [patch 2/2] SecurityPkg/Tcg: " Dandan Bi
2018-07-24  5:09   ` Zhang, Chao B
2018-07-25 14:07   ` Gao, Liming [this message]
2018-07-25 14:07 ` [patch 1/2] MdeModulePkg/DxeLoadFunc: " Gao, Liming

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A89E2EF3DFEDB4C8BFDE51014F606A14E2C0D89@SHSMSX104.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox