From: Jeff Fan Date: Wed, 2 Dec 2015 00:43:19 +0000 (+0000) Subject: UefiCpuPkg/CpuMpPei: Sync BSP's CRx to APs when initialization X-Git-Tag: edk2-stable201903~8402 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=22cfe73a12ce0dc272d790999dcb5c3d94bc1fc6 UefiCpuPkg/CpuMpPei: Sync BSP's CRx to APs when initialization Save BSP's volatile register and sync CRx register to APs when AP 1st wake up. Cc: Feng Tian Cc: Michael Kinney Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan Reviewed-by: Feng Tian git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19088 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/UefiCpuPkg/CpuMpPei/CpuMpPei.c b/UefiCpuPkg/CpuMpPei/CpuMpPei.c index d058d143ce..53af9489b2 100644 --- a/UefiCpuPkg/CpuMpPei/CpuMpPei.c +++ b/UefiCpuPkg/CpuMpPei/CpuMpPei.c @@ -230,6 +230,10 @@ ApCFunction ( if (PeiCpuMpData->InitFlag) { ProcessorNumber = NumApsExecuting; // + // Sync BSP's Control registers to APs + // + RestoreVolatileRegisters (&PeiCpuMpData->CpuData[0].VolatileRegisters, FALSE); + // // This is first time AP wakeup, get BIST information from AP stack // BistData = *(UINTN *) (PeiCpuMpData->Buffer + ProcessorNumber * PeiCpuMpData->CpuApStackSize - sizeof (UINTN)); @@ -560,6 +564,7 @@ PrepareAPStartupVector ( PeiCpuMpData->CpuData[0].Health.Uint32 = 0; PeiCpuMpData->EndOfPeiFlag = FALSE; InitializeSpinLock(&PeiCpuMpData->MpLock); + SaveVolatileRegisters (&PeiCpuMpData->CpuData[0].VolatileRegisters); CopyMem (&PeiCpuMpData->AddressMap, &AddressMap, sizeof (MP_ASSEMBLY_ADDRESS_MAP)); //