From: Jeff Fan <jeff....@intel.com>

CheckProcessorFeature() invokes MpService->StartupAllAps() to detect
XD/BTS features on normal boot path. It's not necessary and may cause
performance impact, because INIT-SIPI-SIPI must be sent to APs if APs
are in hlt-loop mode. XD/BTS feature detection is moved to
SmmInitHandler() in SMM relocation during normal boot path.

Cc: Michael Kinney <michael.d.kin...@intel.com>
Cc: Feng Tian <feng.t...@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff....@intel.com>
---
 UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c | 12 +++++++-----
 UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c     |  4 ++--
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c 
b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c
index db36a0a..50059e4 100644
--- a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c
+++ b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c
@@ -355,6 +355,13 @@ SmmInitHandler (
         &mCpuHotPlugData
         );
 
+      if (!mSmmS3Flag) {
+        //
+        // Check XD and BTS features on each processor on normal boot
+        //
+        CheckFeatureSupported (NULL);
+      }
+
       if (mIsBsp) {
         //
         // BSP rebase is already done above.
@@ -1192,11 +1199,6 @@ PiCpuSmmEntry (
   }
 
   //
-  // Check XD and BTS features
-  //
-  CheckProcessorFeature ();
-
-  //
   // Initialize SMM Profile feature
   //
   InitSmmProfile (Cr3);
diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c 
b/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c
index f9cea55..d315194 100644
--- a/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c
+++ b/UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c
@@ -32,7 +32,7 @@ UINTN                     mMsrDsAreaSize   = 
SMM_PROFILE_DTS_SIZE;
 //
 // The flag indicates if execute-disable is supported by processor.
 //
-BOOLEAN                   mXdSupported     = FALSE;
+BOOLEAN                   mXdSupported     = TRUE;
 
 //
 // The flag indicates if execute-disable is enabled on processor.
@@ -42,7 +42,7 @@ BOOLEAN                   mXdEnabled       = FALSE;
 //
 // The flag indicates if BTS is supported by processor.
 //
-BOOLEAN                   mBtsSupported     = FALSE;
+BOOLEAN                   mBtsSupported     = TRUE;
 
 //
 // The flag indicates if SMM profile starts to record data.
-- 
2.6.3.windows.1

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

Reply via email to