[edk2] [PATCH 2/2] QuarkPlatformPkg: enable SmiHandlerProfile.

Jiewen Yao posted 2 patches 7 years, 7 months ago
[edk2] [PATCH 2/2] QuarkPlatformPkg: enable SmiHandlerProfile.
Posted by Jiewen Yao 7 years, 7 months ago
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Kelly Steele <kelly.steele@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
---
 QuarkPlatformPkg/Quark.dsc    | 14 ++++++++++
 QuarkPlatformPkg/Quark.fdf    |  3 +-
 QuarkPlatformPkg/QuarkMin.dsc |  3 ++
 QuarkPlatformPkg/Readme.md    | 29 ++++++++++++--------
 4 files changed, 37 insertions(+), 12 deletions(-)

diff --git a/QuarkPlatformPkg/Quark.dsc b/QuarkPlatformPkg/Quark.dsc
index 025653e..13c6538 100644
--- a/QuarkPlatformPkg/Quark.dsc
+++ b/QuarkPlatformPkg/Quark.dsc
@@ -41,6 +41,7 @@
   DEFINE LOGGING              = FALSE
   DEFINE CAPSULE_ENABLE       = FALSE
   DEFINE RECOVERY_ENABLE      = FALSE
+  DEFINE SMI_HANDLER_PROFILE_ENABLE = FALSE
 
   #
   # Galileo board.  Options are [GEN1, GEN2]
@@ -163,6 +164,12 @@
   PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf
 !endif
 
+!if $(SMI_HANDLER_PROFILE_ENABLE)
+  SmiHandlerProfileLib|MdeModulePkg/Library/SmmSmiHandlerProfileLib/SmmSmiHandlerProfileLib.inf
+!else
+  SmiHandlerProfileLib|MdePkg/Library/SmiHandlerProfileLibNull/SmiHandlerProfileLibNull.inf
+!endif
+
   OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf
   IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
   BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
@@ -382,6 +389,10 @@
   # waiting for RTC to be busy.
   gEfiMdeModulePkgTokenSpaceGuid.PcdRealTimeClockUpdateTimeout|500000
 
+!if $(SMI_HANDLER_PROFILE_ENABLE)
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSmiHandlerProfilePropertyMask|1
+!endif
+
 !if $(SECURE_BOOT_ENABLE)
   # override the default values from SecurityPkg to ensure images from all sources are verified in secure boot
   gEfiSecurityPkgTokenSpaceGuid.PcdOptionRomImageVerificationPolicy|0x04
@@ -796,6 +807,7 @@
       #
       gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x801000C7
   }
+  MdeModulePkg/Universal/SmmCommunicationBufferDxe/SmmCommunicationBufferDxe.inf
 
   UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.inf
   QuarkSocPkg/QuarkNorthCluster/Smm/Dxe/SmmControlDxe/SmmControlDxe.inf
@@ -939,6 +951,8 @@
   }
 !endif
 
+  MdeModulePkg/Application/SmiHandlerProfileInfo/SmiHandlerProfileInfo.inf
+
 [BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER]
   MSFT:*_*_*_DLINK_FLAGS = /ALIGN:4096
 
diff --git a/QuarkPlatformPkg/Quark.fdf b/QuarkPlatformPkg/Quark.fdf
index 19533b2..34f09af 100644
--- a/QuarkPlatformPkg/Quark.fdf
+++ b/QuarkPlatformPkg/Quark.fdf
@@ -2,7 +2,7 @@
 # FDF file of Clanton Peak CRB platform with 32-bit DXE
 #
 # This package provides QuarkNcSocId platform specific modules.
-# Copyright (c) 2013 - 2016 Intel Corporation.
+# Copyright (c) 2013 - 2017 Intel Corporation.
 #
 # This program and the accompanying materials
 # are licensed and made available under the terms and conditions of the BSD License
@@ -511,6 +511,7 @@ INF  RuleOverride = ACPITABLE QuarkPlatformPkg/Acpi/AcpiTables/AcpiTables.inf
 INF  MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf
 INF  MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf
 INF  UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf
+INF  MdeModulePkg/Universal/SmmCommunicationBufferDxe/SmmCommunicationBufferDxe.inf
 INF  UefiCpuPkg/CpuIo2Smm/CpuIo2Smm.inf
 INF  QuarkSocPkg/QuarkNorthCluster/Smm/Dxe/SmmControlDxe/SmmControlDxe.inf
 INF  QuarkSocPkg/QuarkNorthCluster/Smm/DxeSmm/QncSmmDispatcher/QNCSmmDispatcher.inf
diff --git a/QuarkPlatformPkg/QuarkMin.dsc b/QuarkPlatformPkg/QuarkMin.dsc
index 084f2f4..876e5df 100644
--- a/QuarkPlatformPkg/QuarkMin.dsc
+++ b/QuarkPlatformPkg/QuarkMin.dsc
@@ -150,6 +150,9 @@
 !else
   PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf
 !endif
+
+  SmiHandlerProfileLib|MdePkg/Library/SmiHandlerProfileLibNull/SmiHandlerProfileLibNull.inf
+
 !if $(SECURE_BOOT_ENABLE)
   BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf
   PlatformSecureLib|QuarkPlatformPkg/Library/PlatformSecureLib/PlatformSecureLib.inf
diff --git a/QuarkPlatformPkg/Readme.md b/QuarkPlatformPkg/Readme.md
index f925f9e..d15e50f 100644
--- a/QuarkPlatformPkg/Readme.md
+++ b/QuarkPlatformPkg/Readme.md
@@ -137,17 +137,18 @@ build -a IA32 -t GCC49 -p QuarkPlatformPkg/QuarkMin.dsc
 The table below contains a summary of the build flags to enable or disable
 features on the build command line using ```-D``` flags.
 
-| **Define Name**            | **Default Value** | **Supported Values** |
-| -------------------------- | ----------------- | -------------------- |
-| ```GALILEO```              |              GEN2 | GEN1, GEN2           |
-| ```LOGGING```              |              TRUE | TRUE, FALSE          |
-| ```SOURCE_DEBUG_ENABLE```  |             FALSE | TRUE, FALSE          |
-| ```PERFORMANCE_ENABLE```   |             FALSE | TRUE, FALSE          |
-| ```SECURE_BOOT_ENABLE```   |             FALSE | TRUE, FALSE          |
-| ```MEASURED_BOOT_ENABLE``` |             FALSE | TRUE, FALSE          |
-| ```TPM_12_HARDWARE```      |              NONE | NONE, LPC, ATMEL_I2C, INFINEON_I2C |
-| ```CAPSULE_ENABLE```       |             FALSE | TRUE, FALSE          |
-| ```RECOVERY_ENABLE```      |             FALSE | TRUE, FALSE          |
+| **Define Name**                  | **Default Value** | **Supported Values** |
+| --------------------------       | ----------------- | -------------------- |
+| ```GALILEO```                    |              GEN2 | GEN1, GEN2           |
+| ```LOGGING```                    |              TRUE | TRUE, FALSE          |
+| ```SOURCE_DEBUG_ENABLE```        |             FALSE | TRUE, FALSE          |
+| ```PERFORMANCE_ENABLE```         |             FALSE | TRUE, FALSE          |
+| ```SECURE_BOOT_ENABLE```         |             FALSE | TRUE, FALSE          |
+| ```MEASURED_BOOT_ENABLE```       |             FALSE | TRUE, FALSE          |
+| ```TPM_12_HARDWARE```            |              NONE | NONE, LPC, ATMEL_I2C, INFINEON_I2C |
+| ```CAPSULE_ENABLE```             |             FALSE | TRUE, FALSE          |
+| ```RECOVERY_ENABLE```            |             FALSE | TRUE, FALSE          |
+| ```SMI_HANDLER_PROFILE_ENABLE``` |             FALSE | TRUE, FALSE          |
 
 * ```GALILEO``` - Used to specify the type of Intel(R) Galileo board type.  The
   default is ```GEN2``` for the [Intel(R) Galileo Gen 2 Development Board](
@@ -218,6 +219,12 @@ features on the build command line using ```-D``` flags.
   In next boot, if a user runs ForceRecovery.efi in shell, or if a user presses the RESET button during power on, warm reset or REBOOT,
   or if the FvMain is corrupted in flash, the system will boot into recovery mode.
 
+* ```SMI_HANDLER_PROFILE_ENABLE``` - Used to enable/disable SMI handler profile features.
+  The default is FALSE for disabled.  Add ```-D SMI_HANDLER_PROFILE_ENABLE``` to the
+  build command line to enable SMI handler profile features.
+  A user may enter UEFI shell environment and run ```SmiHandlerProfileInfo >a SmiHandlerQuark.xml```
+  Then the user may enter OS environment and run ```BaseTools\Scripts\SmiHandlerProfileSymbolGen.py -i SmiHandlerQuark.xml -o SmiHandlerQuarkFinal.xml -g Build\<TARGET>_<TOOL_CHAIN_TAG>\FV\Guid.xref```. (NOTE: Please replace <TAGGET> with Build/Release, and <TOOL_CHAIN_TAG> with the real toolchain name.)
+
 ### **Example Build Commands**
 
 Default build with logging enabled:
-- 
2.7.4.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel