summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Fan <jeff.fan@intel.com>2016-11-29 15:48:32 +0800
committerGuo Mang <mang.guo@intel.com>2017-04-12 14:52:42 +0800
commitbe61b1d1c19adb555ee1296547620fef65ab2e85 (patch)
tree5f49c9af7947f3b03ef518900a364d6d026added
parent5cb3e7347d634d99fcf38285d9833bc81d636512 (diff)
downloadedk2-platforms-be61b1d1c19adb555ee1296547620fef65ab2e85.tar.xz
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--Core/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Core/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c b/Core/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
index f14b471bcf..9d75d9070d 100644
--- a/Core/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
+++ b/Core/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;
}
}
}