diff options
author | Jeff Fan <jeff.fan@intel.com> | 2015-12-02 03:26:24 +0000 |
---|---|---|
committer | vanjeff <vanjeff@Edk2> | 2015-12-02 03:26:24 +0000 |
commit | 9d564cd5229bd2cd370cce13093e0d8b60cc7003 (patch) | |
tree | 7b8ad507ce50f7df2899ba4735206ebf8be5303b /UefiCpuPkg/CpuMpPei/CpuMpPei.c | |
parent | 5bdb31378999f8a061427a8903b469cf1d02b72e (diff) | |
download | edk2-platforms-9d564cd5229bd2cd370cce13093e0d8b60cc7003.tar.xz |
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.
(Sync patch r19089 from main trunk.)
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/branches/UDK2015@19095 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'UefiCpuPkg/CpuMpPei/CpuMpPei.c')
-rw-r--r-- | UefiCpuPkg/CpuMpPei/CpuMpPei.c | 10 |
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 ();
}
|