]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UefiCpuPkg/CpuMpPei: Sync BSP's CRx to APs when initialization
authorJeff Fan <jeff.fan@intel.com>
Wed, 2 Dec 2015 00:43:19 +0000 (00:43 +0000)
committervanjeff <vanjeff@Edk2>
Wed, 2 Dec 2015 00:43:19 +0000 (00:43 +0000)
Save BSP's volatile register and sync CRx register to APs when AP 1st wake up.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@Intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19088 6f19259b-4bc3-4df7-8a09-765794883524

UefiCpuPkg/CpuMpPei/CpuMpPei.c

index d058d143ced74557475cd99160837bd3080ccf19..53af9489b2db30b78ba54406e975327a98b6a5ae 100644 (file)
@@ -230,6 +230,10 @@ ApCFunction (
   if (PeiCpuMpData->InitFlag) {\r
     ProcessorNumber = NumApsExecuting;\r
     //\r
   if (PeiCpuMpData->InitFlag) {\r
     ProcessorNumber = NumApsExecuting;\r
     //\r
+    // Sync BSP's Control registers to APs\r
+    //\r
+    RestoreVolatileRegisters (&PeiCpuMpData->CpuData[0].VolatileRegisters, FALSE);\r
+    //\r
     // This is first time AP wakeup, get BIST information from AP stack\r
     //\r
     BistData = *(UINTN *) (PeiCpuMpData->Buffer + ProcessorNumber * PeiCpuMpData->CpuApStackSize - sizeof (UINTN));\r
     // This is first time AP wakeup, get BIST information from AP stack\r
     //\r
     BistData = *(UINTN *) (PeiCpuMpData->Buffer + ProcessorNumber * PeiCpuMpData->CpuApStackSize - sizeof (UINTN));\r
@@ -560,6 +564,7 @@ PrepareAPStartupVector (
   PeiCpuMpData->CpuData[0].Health.Uint32 = 0;\r
   PeiCpuMpData->EndOfPeiFlag             = FALSE;\r
   InitializeSpinLock(&PeiCpuMpData->MpLock);\r
   PeiCpuMpData->CpuData[0].Health.Uint32 = 0;\r
   PeiCpuMpData->EndOfPeiFlag             = FALSE;\r
   InitializeSpinLock(&PeiCpuMpData->MpLock);\r
+  SaveVolatileRegisters (&PeiCpuMpData->CpuData[0].VolatileRegisters);\r
   CopyMem (&PeiCpuMpData->AddressMap, &AddressMap, sizeof (MP_ASSEMBLY_ADDRESS_MAP));\r
 \r
   //\r
   CopyMem (&PeiCpuMpData->AddressMap, &AddressMap, sizeof (MP_ASSEMBLY_ADDRESS_MAP));\r
 \r
   //\r