]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UefiCpuPkg/CpuMpPei: Save/Restore CRx/DRx register for APs waking up
authorJeff Fan <jeff.fan@intel.com>
Wed, 2 Dec 2015 00:43:45 +0000 (00:43 +0000)
committervanjeff <vanjeff@Edk2>
Wed, 2 Dec 2015 00:43:45 +0000 (00:43 +0000)
PeiStartupAllAPs()/PeiStartupThisAP() will send INIT-SIPI-SIPI to wakeup APs to
execute AP function. However, some registers will be reset after APs received
INIT IPI. We need to restore some registers (For example, CRx/DRx) manually
after APs wakeup.

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@19089 6f19259b-4bc3-4df7-8a09-765794883524

UefiCpuPkg/CpuMpPei/CpuMpPei.c

index 53af9489b2db30b78ba54406e975327a98b6a5ae..ca486135029ac60b9f3d213292b4deb580e4876b 100644 (file)
@@ -259,6 +259,11 @@ ApCFunction (
     // Execute AP function if AP is not disabled\r
     //\r
     GetProcessorNumber (PeiCpuMpData, &ProcessorNumber);\r
+    //\r
+    // Restore AP's volatile registers saved\r
+    //\r
+    RestoreVolatileRegisters (&PeiCpuMpData->CpuData[ProcessorNumber].VolatileRegisters, TRUE);\r
+\r
     if ((PeiCpuMpData->CpuData[ProcessorNumber].State != CpuStateDisabled) &&\r
         (PeiCpuMpData->ApFunction != 0)) {\r
       PeiCpuMpData->CpuData[ProcessorNumber].State = CpuStateBusy;\r
@@ -273,6 +278,11 @@ ApCFunction (
   //\r
   InterlockedIncrement ((UINT32 *)&PeiCpuMpData->FinishedCount);\r
 \r
+  //\r
+  // Save AP volatile registers\r
+  //\r
+  SaveVolatileRegisters (&PeiCpuMpData->CpuData[ProcessorNumber].VolatileRegisters);\r
+\r
   AsmCliHltLoop ();\r
 }\r
 \r