summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Fan <jeff.fan@intel.com>2016-11-29 15:48:32 +0800
committerJeff Fan <jeff.fan@intel.com>2016-12-02 10:39:26 +0800
commitbb0034fd8e45e6021f0998e6771f208916e8fcca (patch)
tree1b3222e9a8c0a38d24a1ff14c35f089a7bb324f6
parente5a2fa3aa536490c704345ecd6a7fbb18245cf94 (diff)
downloadedk2-bb0034fd8e45e6021f0998e6771f208916e8fcca.zip
edk2-bb0034fd8e45e6021f0998e6771f208916e8fcca.tar.gz
edk2-bb0034fd8e45e6021f0998e6771f208916e8fcca.tar.bz2
UefiCpuPkg/PiSmmCpuDxeSmm: Clear some semaphores on S3 boot path
Some semaphores are not cleared on S3 boot path. For example, mSmmMpSyncData->CpuData[CpuIndex].Present. It may still keeps the value set at SMM runtime during S3 resume. It may causes BSP have the wrong judgement on SMM AP's present state. We have one related fix at e78a2a49ee6b0c0d7c6997c87ace31d7761cf636. But that is not completed. This fix is to clear Busy/Run/Present semaphores in InitializeMpSyncData(). Cc: Laszlo Ersek <lersek@redhat.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Acked-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Feng Tian <feng.tian@intel.com> (cherry picked from commit 56e4a7d72660b229be333bbb5e1b5790d3c17890)
-rw-r--r--UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
index f14b471..9d75d90 100644
--- a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
+++ b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
@@ -1297,6 +1297,9 @@ InitializeMpSyncData (
(UINT32 *)((UINTN)mSmmCpuSemaphores.SemaphoreCpu.Run + mSemaphoreSize * CpuIndex);
mSmmMpSyncData->CpuData[CpuIndex].Present =
(BOOLEAN *)((UINTN)mSmmCpuSemaphores.SemaphoreCpu.Present + mSemaphoreSize * CpuIndex);
+ *(mSmmMpSyncData->CpuData[CpuIndex].Busy) = 0;
+ *(mSmmMpSyncData->CpuData[CpuIndex].Run) = 0;
+ *(mSmmMpSyncData->CpuData[CpuIndex].Present) = FALSE;
}
}
}