UefiCpuPkg/CpuMpPei: Sync BPS's mtrr setting to APs
authorJeff Fan <jeff.fan@intel.com>
Wed, 15 Jul 2015 03:39:24 +0000 (03:39 +0000)
committervanjeff <vanjeff@Edk2>
Wed, 15 Jul 2015 03:39:24 +0000 (03:39 +0000)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17999 6f19259b-4bc3-4df7-8a09-765794883524

UefiCpuPkg/CpuMpPei/CpuMpPei.c
UefiCpuPkg/CpuMpPei/CpuMpPei.h
UefiCpuPkg/CpuMpPei/CpuMpPei.inf

index a2f25b94050f012c65a1c65afbfd63e1c02f6840..e39a813cdd189c8e4a6cbf039ec5411709352151 100644 (file)
@@ -118,6 +118,10 @@ ApCFunction (
     BistData = *(UINTN *) (PeiCpuMpData->Buffer + NumApsExecuting * PeiCpuMpData->CpuApStackSize - sizeof (UINTN));
     PeiCpuMpData->CpuData[NumApsExecuting].ApicId        = GetInitialApicId ();
     PeiCpuMpData->CpuData[NumApsExecuting].Health.Uint32 = (UINT32) BistData;
+    //
+    // Sync BSP's Mtrr table to all wakeup APs
+    //
+    MtrrSetAllMtrrs (&PeiCpuMpData->MtrrTable);
   }
 
   //
@@ -285,6 +289,10 @@ CountProcessorNumber (
   )
 {
 
+  //
+  // Store BSP's MTRR setting
+  //
+  MtrrGetAllMtrrs (&PeiCpuMpData->MtrrTable);
   //
   // Send broadcast IPI to APs to wakeup APs
   //
index 3194f1f0fa338f336ca0fae0752cb739b98d1acf..466ddc055838f37835d81b3e0207f7c3966d2be4 100644 (file)
@@ -24,6 +24,7 @@
 #include <Library/DebugLib.h>
 #include <Library/HobLib.h>
 #include <Library/LocalApicLib.h>
+#include <Library/MtrrLib.h>
 #include <Library/PcdLib.h>
 #include <Library/PeimEntryPoint.h>
 #include <Library/PeiServicesLib.h>
@@ -115,6 +116,7 @@ struct _PEI_CPU_MP_DATA {
   UINTN                          ApFunctionArgument;
   volatile UINT32                FinishedCount;
   BOOLEAN                        InitFlag;
+  MTRR_SETTINGS                  MtrrTable;
   PEI_CPU_DATA                   *CpuData;
   volatile MP_CPU_EXCHANGE_INFO  *MpCpuExchangeInfo;
 };
index 4d7ba3e1283e481cf7e50f9d414a45e8a8f228ac..e195f8c3d810caf90689faf78e13b1223a6cfe0a 100644 (file)
@@ -53,6 +53,7 @@
   DebugLib
   HobLib
   LocalApicLib
+  MtrrLib
   PcdLib
   PeimEntryPoint
   PeiServicesLib