summaryrefslogtreecommitdiffstats
path: root/UefiCpuPkg/PiSmmCpuDxeSmm
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-01 15:22:02 +0800
commit56e4a7d72660b229be333bbb5e1b5790d3c17890 (patch)
tree065bfe446f34343153f1ff9df4b0c186dab8438c /UefiCpuPkg/PiSmmCpuDxeSmm
parenteae631bc687c3cbfab01632ce3bc21783d22b590 (diff)
downloadedk2-56e4a7d72660b229be333bbb5e1b5790d3c17890.tar.gz
edk2-56e4a7d72660b229be333bbb5e1b5790d3c17890.tar.bz2
edk2-56e4a7d72660b229be333bbb5e1b5790d3c17890.zip
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>
Diffstat (limited to 'UefiCpuPkg/PiSmmCpuDxeSmm')
-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 cfbf59e8f2..a873b68c30 100644
--- a/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
+++ b/UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c
@@ -1357,6 +1357,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;
}
}
}