public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Star Zeng <star.zeng@intel.com>
To: edk2-devel@lists.01.org
Cc: Star Zeng <star.zeng@intel.com>, Liming Gao <liming.gao@intel.com>
Subject: [PATCH 3/3] MdeModulePkg FirmwarePerfPei: Remove SEC performance data getting code
Date: Mon, 31 Jul 2017 11:31:57 +0800	[thread overview]
Message-ID: <1501471917-11272-4-git-send-email-star.zeng@intel.com> (raw)
In-Reply-To: <1501471917-11272-1-git-send-email-star.zeng@intel.com>

Current SEC performance data getting code in FirmwarePerformancePei
may get wrong SEC performance data if FirmwarePerformancePei executes
after memory discovered.

And as SecCore has added SecPerformancePpiCallBack to get SEC performance
data and build HOB to convey the SEC performance data to DXE phase.

This patch is to remove the SEC performance data getting code in
FirmwarePerformancePei.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
---
 .../FirmwarePerformancePei.c                       | 39 ++--------------------
 .../FirmwarePerformancePei.inf                     |  9 +----
 .../FirmwarePerformancePei.uni                     |  6 ++--
 3 files changed, 6 insertions(+), 48 deletions(-)

diff --git a/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTablePei/FirmwarePerformancePei.c b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTablePei/FirmwarePerformancePei.c
index 396462e7aa97..e4800b7bdd8a 100644
--- a/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTablePei/FirmwarePerformancePei.c
+++ b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTablePei/FirmwarePerformancePei.c
@@ -1,13 +1,11 @@
 /** @file
   This module updates S3 Resume Performance Record in ACPI Firmware Performance
-  Data Table in S3 resume boot mode. In normal boot mode, this module consumes
-  SecPerformance PPI produced by SEC phase and build Hob to convey the SEC
-  performance data to DXE phase.
+  Data Table in S3 resume boot mode.
 
   This module register report status code listener to collect performance data
   for S3 Resume Performance Record on S3 resume boot path.
 
-  Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2011 - 2017, Intel Corporation. All rights reserved.<BR>
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD License
   which accompanies this distribution.  The full text of the license may be found at
@@ -21,7 +19,6 @@
 #include <PiPei.h>
 
 #include <Ppi/ReportStatusCodeHandler.h>
-#include <Ppi/SecPerformance.h>
 
 #include <Guid/FirmwarePerformance.h>
 
@@ -31,7 +28,6 @@
 #include <Library/TimerLib.h>
 #include <Library/BaseMemoryLib.h>
 #include <Library/LockBoxLib.h>
-#include <Library/HobLib.h>
 #include <Library/PcdLib.h>
 
 /**
@@ -79,7 +75,7 @@ FpdtStatusCodeListenerPei (
   // Check whether status code is what we are interested in.
   //
   if (((CodeType & EFI_STATUS_CODE_TYPE_MASK) != EFI_PROGRESS_CODE) ||
-  	  (Value != (EFI_SOFTWARE_PEI_MODULE | EFI_SW_PEI_PC_OS_WAKE))) {
+      (Value != (EFI_SOFTWARE_PEI_MODULE | EFI_SW_PEI_PC_OS_WAKE))) {
     return EFI_UNSUPPORTED;
   }
 
@@ -157,8 +153,6 @@ FirmwarePerformancePeiEntryPoint (
 {
   EFI_STATUS               Status;
   EFI_PEI_RSC_HANDLER_PPI  *RscHandler;
-  PEI_SEC_PERFORMANCE_PPI  *SecPerf;
-  FIRMWARE_SEC_PERFORMANCE Performance;
 
   if (FeaturePcdGet (PcdFirmwarePerformanceDataTableS3Support)) {
     //
@@ -176,32 +170,5 @@ FirmwarePerformancePeiEntryPoint (
     ASSERT_EFI_ERROR (Status);
   }
 
-  //
-  // Normal boot - build Hob for SEC performance data.
-  //
-  Status = PeiServicesLocatePpi (
-             &gPeiSecPerformancePpiGuid,
-             0,
-             NULL,
-             (VOID **) &SecPerf
-             );
-  if (!EFI_ERROR (Status)) {
-    Status = SecPerf->GetPerformance (PeiServices, SecPerf, &Performance);
-  }
-  if (!EFI_ERROR (Status)) {
-    BuildGuidDataHob (
-      &gEfiFirmwarePerformanceGuid,
-      &Performance,
-      sizeof (FIRMWARE_SEC_PERFORMANCE)
-    );
-    DEBUG ((EFI_D_INFO, "FPDT: SEC Performance Hob ResetEnd = %ld\n", Performance.ResetEnd));
-  } else {
-    //
-    // SEC performance PPI is not installed or fail to get performance data
-    // from SEC Performance PPI.
-    //
-    DEBUG ((EFI_D_ERROR, "FPDT: WARNING: SEC Performance PPI not installed or failed!\n"));
-  }
-
   return EFI_SUCCESS;
 }
diff --git a/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTablePei/FirmwarePerformancePei.inf b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTablePei/FirmwarePerformancePei.inf
index 25049f832371..88cd0af8a1b2 100644
--- a/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTablePei/FirmwarePerformancePei.inf
+++ b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTablePei/FirmwarePerformancePei.inf
@@ -2,13 +2,11 @@
 #  Firmware Performance Pei Module.
 #
 #  In S3 resume boot mode, it updates S3 Resume Performance Record in ACPI Firmware Performance Data Table.
-#  In normal boot mode, it consumes SecPerformance PPI produced by SEC phase
-#  and build Hob to convey the SEC performance data to DXE phase.
 #
 #  This module register report status code listener to collect performance data
 #  for S3 Resume Performance Record on S3 resume boot path.
 #
-#  Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>
+#  Copyright (c) 2011 - 2017, Intel Corporation. All rights reserved.<BR>
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD License
 #  which accompanies this distribution.  The full text of the license may be found at
@@ -46,7 +44,6 @@ [LibraryClasses]
   PeiServicesLib
   BaseLib
   DebugLib
-  HobLib
   TimerLib
   BaseMemoryLib
   LockBoxLib
@@ -54,13 +51,9 @@ [LibraryClasses]
 
 [Ppis]
   gEfiPeiRscHandlerPpiGuid                      ## CONSUMES
-  gPeiSecPerformancePpiGuid                     ## SOMETIMES_CONSUMES
 
 [Guids]
   ## SOMETIMES_CONSUMES   ## UNDEFINED # RestoreLockBox
-  ## SOMETIMES_PRODUCES   ## HOB
-  ## SOMETIMES_CONSUMES   ## Variable:L"FirmwarePerformance"
-  gEfiFirmwarePerformanceGuid
   gFirmwarePerformanceS3PointerGuid             ## SOMETIMES_CONSUMES ## UNDEFINED # RestoreLockBox
 
 [FeaturePcd]
diff --git a/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTablePei/FirmwarePerformancePei.uni b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTablePei/FirmwarePerformancePei.uni
index 8e718c0c0126..3ae182c7d65e 100644
--- a/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTablePei/FirmwarePerformancePei.uni
+++ b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTablePei/FirmwarePerformancePei.uni
@@ -2,13 +2,11 @@
 // Firmware Performance Pei Module.
 //
 // In S3 resume boot mode, it updates S3 Resume Performance Record in ACPI Firmware Performance Data Table.
-// In normal boot mode, it consumes SecPerformance PPI produced by SEC phase
-// and build Hob to convey the SEC performance data to DXE phase.
 // 
 // This module register report status code listener to collect performance data
 // for S3 Resume Performance Record on S3 resume boot path.
 //
-// Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>
+// Copyright (c) 2011 - 2017, Intel Corporation. All rights reserved.<BR>
 //
 // This program and the accompanying materials
 // are licensed and made available under the terms and conditions of the BSD License
@@ -23,5 +21,5 @@
 
 #string STR_MODULE_ABSTRACT             #language en-US "Firmware Performance Pei Module."
 
-#string STR_MODULE_DESCRIPTION          #language en-US "In S3 resume boot mode, it updates S3 Resume Performance Record in ACPI Firmware Performance Data Table. In normal boot mode, it consumes SecPerformance PPI produced by SEC phase and builds a Hob to convey the SEC performance data to DXE phase. This module register report status code listener to collect performance data for S3 Resume Performance Record on S3 resume boot path."
+#string STR_MODULE_DESCRIPTION          #language en-US "In S3 resume boot mode, it updates S3 Resume Performance Record in ACPI Firmware Performance Data Table. This module register report status code listener to collect performance data for S3 Resume Performance Record on S3 resume boot path."
 
-- 
2.7.0.windows.1



  parent reply	other threads:[~2017-07-31  3:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-31  3:31 [PATCH 0/3] Add SecPerformancePpiCallBack to get SEC performance data in SecCore Star Zeng
2017-07-31  3:31 ` [PATCH 1/3] UefiCpuPkg SecCore: Adjust PeiTemporaryRamBase&Size to be 8byte aligned Star Zeng
2017-07-31  4:55   ` Fan, Jeff
2017-07-31  3:31 ` [PATCH 2/3] UefiCpuPkg SecCore: Add SecPerformancePpiCallBack Star Zeng
2017-07-31  4:56   ` Fan, Jeff
2017-07-31  3:31 ` Star Zeng [this message]
2017-08-01  9:01 ` [PATCH 0/3] Add SecPerformancePpiCallBack to get SEC performance data in SecCore 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=1501471917-11272-4-git-send-email-star.zeng@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