summaryrefslogtreecommitdiffstats
path: root/UefiCpuPkg/CpuMpPei
diff options
context:
space:
mode:
authorJeff Fan <jeff.fan@intel.com>2015-12-02 00:43:45 +0000
committervanjeff <vanjeff@Edk2>2015-12-02 00:43:45 +0000
commitf40a7de45070dfa193e47ed0031cc07c275287b3 (patch)
tree2f4a86e96ca82d35446be91b658e8677ad023242 /UefiCpuPkg/CpuMpPei
parent22cfe73a12ce0dc272d790999dcb5c3d94bc1fc6 (diff)
downloadedk2-f40a7de45070dfa193e47ed0031cc07c275287b3.tar.gz
edk2-f40a7de45070dfa193e47ed0031cc07c275287b3.tar.bz2
edk2-f40a7de45070dfa193e47ed0031cc07c275287b3.zip
UefiCpuPkg/CpuMpPei: Save/Restore CRx/DRx register for APs waking up
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
Diffstat (limited to 'UefiCpuPkg/CpuMpPei')
-rw-r--r--UefiCpuPkg/CpuMpPei/CpuMpPei.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/UefiCpuPkg/CpuMpPei/CpuMpPei.c b/UefiCpuPkg/CpuMpPei/CpuMpPei.c
index 53af9489b2..ca48613502 100644
--- a/UefiCpuPkg/CpuMpPei/CpuMpPei.c
+++ b/UefiCpuPkg/CpuMpPei/CpuMpPei.c
@@ -259,6 +259,11 @@ ApCFunction (
// Execute AP function if AP is not disabled
//
GetProcessorNumber (PeiCpuMpData, &ProcessorNumber);
+ //
+ // Restore AP's volatile registers saved
+ //
+ RestoreVolatileRegisters (&PeiCpuMpData->CpuData[ProcessorNumber].VolatileRegisters, TRUE);
+
if ((PeiCpuMpData->CpuData[ProcessorNumber].State != CpuStateDisabled) &&
(PeiCpuMpData->ApFunction != 0)) {
PeiCpuMpData->CpuData[ProcessorNumber].State = CpuStateBusy;
@@ -273,6 +278,11 @@ ApCFunction (
//
InterlockedIncrement ((UINT32 *)&PeiCpuMpData->FinishedCount);
+ //
+ // Save AP volatile registers
+ //
+ SaveVolatileRegisters (&PeiCpuMpData->CpuData[ProcessorNumber].VolatileRegisters);
+
AsmCliHltLoop ();
}