It's good.

Reviewed-by: Jeff Fan <[email protected]>

-----Original Message-----
From: Laszlo Ersek [mailto:[email protected]] 
Sent: Saturday, May 09, 2015 2:52 AM
To: [email protected]
Cc: Fan, Jeff; Chen Fan; Justen, Jordan L
Subject: [PATCH 10/11] UefiCpuPkg: CpuDxe: sync MTRR settings to APs at MP 
startup

The logic visible in the previous patch should be done at startup as well, not 
only when MTRR settings are changed. The inspiration is taken from

  Quark_EDKII_v1.1.0/IA32FamilyCpuBasePkg/CpuMpDxe/

(see the EarlyMpInit() function and its call sites in "ProcessorConfig.c").

Cc: Jeff Fan <[email protected]>
Cc: Chen Fan <[email protected]>
Cc: Jordan Justen <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <[email protected]>
---
 UefiCpuPkg/CpuDxe/CpuMp.c | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/UefiCpuPkg/CpuDxe/CpuMp.c b/UefiCpuPkg/CpuDxe/CpuMp.c index 
fa0ef37..ee6fd5c 100644
--- a/UefiCpuPkg/CpuDxe/CpuMp.c
+++ b/UefiCpuPkg/CpuDxe/CpuMp.c
@@ -14,6 +14,7 @@
 
 #include "CpuDxe.h"
 #include "CpuMp.h"
+#include "MtrrSync.h"
 
 UINTN gMaxLogicalProcessorNumber;
 UINTN gApStackSize;
@@ -1551,7 +1552,8 @@ InitializeMpSupport (
   VOID
   )
 {
-  EFI_STATUS Status;
+  EFI_STATUS    Status;
+  MTRR_SETTINGS MtrrSettings;
 
   gMaxLogicalProcessorNumber = (UINTN) PcdGet32 
(PcdCpuMaxLogicalProcessorNumber);
   if (gMaxLogicalProcessorNumber < 1) { @@ -1597,6 +1599,21 @@ 
InitializeMpSupport (
 
   mAPsAlreadyInitFinished = TRUE;
 
+  //
+  // Synchronize MTRR settings to APs.
+  //
+  MtrrGetAllMtrrs (&MtrrSettings);
+  Status = mMpServicesTemplate.StartupAllAPs (
+                                 &mMpServicesTemplate, // This
+                                 LoadMtrrData,         // Procedure
+                                 TRUE,                 // SingleThread
+                                 NULL,                 // WaitEvent
+                                 0,                    // TimeoutInMicrosecsond
+                                 &MtrrSettings,        // ProcedureArgument
+                                 NULL                  // FailedCpuList
+                                 );
+  ASSERT_EFI_ERROR (Status);
+
   Status = gBS->InstallMultipleProtocolInterfaces (
                   &mMpServiceHandle,
                   &gEfiMpServiceProtocolGuid,  &mMpServicesTemplate,
--
1.8.3.1



------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to