public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Dandan Bi <dandan.bi@intel.com>
To: edk2-devel@lists.01.org
Cc: Liming Gao <liming.gao@intel.com>, Chao Zhang <chao.b.zhang@intel.com>
Subject: [patch 8/9] SecurityPkg: Use new added Perf macros
Date: Tue, 19 Jun 2018 15:24:04 +0800	[thread overview]
Message-ID: <20180619072405.142872-9-dandan.bi@intel.com> (raw)
In-Reply-To: <20180619072405.142872-1-dandan.bi@intel.com>

Replace old Perf macros with the new added ones.

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>
---
 .../DxeRsa2048Sha256GuidedSectionExtractLib.c            | 16 ++++++++--------
 .../PeiRsa2048Sha256GuidedSectionExtractLib.c            | 16 ++++++++--------
 2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/SecurityPkg/Library/DxeRsa2048Sha256GuidedSectionExtractLib/DxeRsa2048Sha256GuidedSectionExtractLib.c b/SecurityPkg/Library/DxeRsa2048Sha256GuidedSectionExtractLib/DxeRsa2048Sha256GuidedSectionExtractLib.c
index 39768fbac22..d6f4207a506 100644
--- a/SecurityPkg/Library/DxeRsa2048Sha256GuidedSectionExtractLib/DxeRsa2048Sha256GuidedSectionExtractLib.c
+++ b/SecurityPkg/Library/DxeRsa2048Sha256GuidedSectionExtractLib/DxeRsa2048Sha256GuidedSectionExtractLib.c
@@ -161,13 +161,13 @@ Rsa2048Sha256GuidedSectionHandler (
     // Get the RSA 2048 SHA 256 information.
     //
     CertBlockRsa2048Sha256 = &((RSA_2048_SHA_256_SECTION2_HEADER *) InputSection)->CertBlockRsa2048Sha256;
     OutputBufferSize       = SECTION2_SIZE (InputSection) - sizeof (RSA_2048_SHA_256_SECTION2_HEADER);
     if ((((EFI_GUID_DEFINED_SECTION *)InputSection)->Attributes & EFI_GUIDED_SECTION_PROCESSING_REQUIRED) != 0) {
-      PERF_START (NULL, "RsaCopy", "DXE", 0);
+      PERF_INMODULE_BEGIN ("DxeRsaCopy");
       CopyMem (*OutputBuffer, (UINT8 *)InputSection + sizeof (RSA_2048_SHA_256_SECTION2_HEADER), OutputBufferSize);
-      PERF_END (NULL, "RsaCopy", "DXE", 0);
+      PERF_INMODULE_END ("DxeRsaCopy");
     } else {
       *OutputBuffer = (UINT8 *)InputSection + sizeof (RSA_2048_SHA_256_SECTION2_HEADER);
     }
 
     //
@@ -189,13 +189,13 @@ Rsa2048Sha256GuidedSectionHandler (
     // Get the RSA 2048 SHA 256 information.
     //
     CertBlockRsa2048Sha256 = &((RSA_2048_SHA_256_SECTION_HEADER *)InputSection)->CertBlockRsa2048Sha256;
     OutputBufferSize       = SECTION_SIZE (InputSection) - sizeof (RSA_2048_SHA_256_SECTION_HEADER);
     if ((((EFI_GUID_DEFINED_SECTION *)InputSection)->Attributes & EFI_GUIDED_SECTION_PROCESSING_REQUIRED) != 0) {
-      PERF_START (NULL, "RsaCopy", "DXE", 0);
+      PERF_INMODULE_BEGIN ("DxeRsaCopy");
       CopyMem (*OutputBuffer, (UINT8 *)InputSection + sizeof (RSA_2048_SHA_256_SECTION_HEADER), OutputBufferSize);
-      PERF_END (NULL, "RsaCopy", "DXE", 0);
+      PERF_INMODULE_END ("DxeRsaCopy");
     } else {
       *OutputBuffer = (UINT8 *)InputSection + sizeof (RSA_2048_SHA_256_SECTION_HEADER);
     }
 
     //
@@ -325,13 +325,13 @@ Rsa2048Sha256GuidedSectionHandler (
   if (!CryptoStatus) {
     DEBUG ((DEBUG_ERROR, "DxeRsa2048Sha256: Sha256Init() failed\n"));
     *AuthenticationStatus |= EFI_AUTH_STATUS_TEST_FAILED;
     goto Done;
   }
-  PERF_START (NULL, "RsaShaData", "DXE", 0);
+  PERF_INMODULE_BEGIN ("DxeRsaShaData");
   CryptoStatus = Sha256Update (HashContext, *OutputBuffer, OutputBufferSize);
-  PERF_END (NULL, "RsaShaData", "DXE", 0);
+  PERF_INMODULE_END ("DxeRsaShaData");
   if (!CryptoStatus) {
     DEBUG ((DEBUG_ERROR, "DxeRsa2048Sha256: Sha256Update() failed\n"));
     *AuthenticationStatus |= EFI_AUTH_STATUS_TEST_FAILED;
     goto Done;
   }
@@ -343,19 +343,19 @@ Rsa2048Sha256GuidedSectionHandler (
   }
 
   //
   // Verify the RSA 2048 SHA 256 signature.
   //
-  PERF_START (NULL, "RsaVerify", "DXE", 0);
+  PERF_INMODULE_BEGIN ("DxeRsaVerify");
   CryptoStatus = RsaPkcs1Verify (
                    Rsa, 
                    Digest, 
                    SHA256_DIGEST_SIZE, 
                    CertBlockRsa2048Sha256->Signature, 
                    sizeof (CertBlockRsa2048Sha256->Signature)
                    );
-  PERF_END (NULL, "RsaVerify", "DXE", 0);
+  PERF_INMODULE_END ("DxeRsaVerify");
   if (!CryptoStatus) {
     //
     // If RSA 2048 SHA 256 signature verification fails, AUTH tested failed bit is set.
     //
     DEBUG ((DEBUG_ERROR, "DxeRsa2048Sha256: RsaPkcs1Verify() failed\n"));
diff --git a/SecurityPkg/Library/PeiRsa2048Sha256GuidedSectionExtractLib/PeiRsa2048Sha256GuidedSectionExtractLib.c b/SecurityPkg/Library/PeiRsa2048Sha256GuidedSectionExtractLib/PeiRsa2048Sha256GuidedSectionExtractLib.c
index ba1c700ad03..2272308ddca 100644
--- a/SecurityPkg/Library/PeiRsa2048Sha256GuidedSectionExtractLib/PeiRsa2048Sha256GuidedSectionExtractLib.c
+++ b/SecurityPkg/Library/PeiRsa2048Sha256GuidedSectionExtractLib/PeiRsa2048Sha256GuidedSectionExtractLib.c
@@ -158,13 +158,13 @@ Rsa2048Sha256GuidedSectionHandler (
     // Get the RSA 2048 SHA 256 information.
     //
     CertBlockRsa2048Sha256 = &((RSA_2048_SHA_256_SECTION2_HEADER *) InputSection)->CertBlockRsa2048Sha256;
     OutputBufferSize       = SECTION2_SIZE (InputSection) - sizeof (RSA_2048_SHA_256_SECTION2_HEADER);
     if ((((EFI_GUID_DEFINED_SECTION *)InputSection)->Attributes & EFI_GUIDED_SECTION_PROCESSING_REQUIRED) != 0) {
-      PERF_START (NULL, "RsaCopy", "PEI", 0);
+      PERF_INMODULE_BEGIN ("PeiRsaCopy");
       CopyMem (*OutputBuffer, (UINT8 *)InputSection + sizeof (RSA_2048_SHA_256_SECTION2_HEADER), OutputBufferSize);
-      PERF_END (NULL, "RsaCopy", "PEI", 0);
+      PERF_INMODULE_END ("PeiRsaCopy");
     } else {
       *OutputBuffer = (UINT8 *)InputSection + sizeof (RSA_2048_SHA_256_SECTION2_HEADER);
     }
 
     //
@@ -186,13 +186,13 @@ Rsa2048Sha256GuidedSectionHandler (
     // Get the RSA 2048 SHA 256 information.
     //
     CertBlockRsa2048Sha256 = &((RSA_2048_SHA_256_SECTION_HEADER *)InputSection)->CertBlockRsa2048Sha256;
     OutputBufferSize       = SECTION_SIZE (InputSection) - sizeof (RSA_2048_SHA_256_SECTION_HEADER);
     if ((((EFI_GUID_DEFINED_SECTION *)InputSection)->Attributes & EFI_GUIDED_SECTION_PROCESSING_REQUIRED) != 0) {
-      PERF_START (NULL, "RsaCopy", "PEI", 0);
+      PERF_INMODULE_BEGIN ("PeiRsaCopy");
       CopyMem (*OutputBuffer, (UINT8 *)InputSection + sizeof (RSA_2048_SHA_256_SECTION_HEADER), OutputBufferSize);
-      PERF_END (NULL, "RsaCopy", "PEI", 0);
+      PERF_INMODULE_END ("PeiRsaCopy");
     } else {
       *OutputBuffer = (UINT8 *)InputSection + sizeof (RSA_2048_SHA_256_SECTION_HEADER);
     }
 
     //
@@ -309,13 +309,13 @@ Rsa2048Sha256GuidedSectionHandler (
   if (!CryptoStatus) {
     DEBUG ((DEBUG_ERROR, "PeiRsa2048Sha256: Sha256Init() failed\n"));
     *AuthenticationStatus |= EFI_AUTH_STATUS_TEST_FAILED;
     goto Done;
   }
-  PERF_START (NULL, "RsaShaData", "PEI", 0);
+  PERF_INMODULE_BEGIN ("PeiRsaShaData");
   CryptoStatus = Sha256Update (HashContext, *OutputBuffer, OutputBufferSize);
-  PERF_END (NULL, "RsaShaData", "PEI", 0);
+  PERF_INMODULE_END ("PeiRsaShaData");
   if (!CryptoStatus) {
     DEBUG ((DEBUG_ERROR, "PeiRsa2048Sha256: Sha256Update() failed\n"));
     *AuthenticationStatus |= EFI_AUTH_STATUS_TEST_FAILED;
     goto Done;
   }
@@ -327,19 +327,19 @@ Rsa2048Sha256GuidedSectionHandler (
   }
 
   //
   // Verify the RSA 2048 SHA 256 signature.
   //
-  PERF_START (NULL, "RsaVerify", "PEI", 0);
+  PERF_INMODULE_BEGIN ("PeiRsaVerify");
   CryptoStatus = RsaPkcs1Verify (
                    Rsa, 
                    Digest, 
                    SHA256_DIGEST_SIZE, 
                    CertBlockRsa2048Sha256->Signature, 
                    sizeof (CertBlockRsa2048Sha256->Signature)
                    );
-  PERF_END (NULL, "RsaVerify", "PEI", 0);
+  PERF_INMODULE_END ("PeiRsaVerify");
   if (!CryptoStatus) {
     //
     // If RSA 2048 SHA 256 signature verification fails, AUTH tested failed bit is set.
     //
     DEBUG ((DEBUG_ERROR, "PeiRsa2048Sha256: RsaPkcs1Verify() failed\n"));
-- 
2.14.3.windows.1



  parent reply	other threads:[~2018-06-19  7:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-19  7:23 [patch 0/9] Add new Perf macros Dandan Bi
2018-06-19  7:23 ` [patch 1/9] MdeModulePkg: Add PERFORMANCE_MEASUREMENT_PROTOCOL Dandan Bi
2018-06-19  7:23 ` [patch 2/9] MdeModulePkg: Update Performance instances to use new protocol Dandan Bi
2018-06-19  7:23 ` [patch 3/9] MdePkg/PerformanceLib.h: Add new Perf macros Dandan Bi
2018-06-19  7:24 ` [patch 4/9] MdeModulePkg/ExtendedFirmwarePerf: Remove PerfId definitions Dandan Bi
2018-06-19  7:24 ` [patch 5/9] MdeModulePkg: Update performance library instances Dandan Bi
2018-06-19  7:24 ` [patch 6/9] ShellPkg/dp: Update dp tool to parse new Perf record Dandan Bi
2018-06-19  7:24 ` [patch 7/9] MdeModulePkg: Use new added Perf macros Dandan Bi
2018-06-19  7:24 ` Dandan Bi [this message]
2018-06-19  7:24 ` [patch 9/9] UefiCpuPkg: " Dandan Bi

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=20180619072405.142872-9-dandan.bi@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