From 56e4a7d72660b229be333bbb5e1b5790d3c17890 Mon Sep 17 00:00:00 2001 From: Jeff Fan Date: Tue, 29 Nov 2016 15:48:32 +0800 Subject: 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 Cc: Feng Tian Cc: Jiewen Yao Cc: Michael D Kinney Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan Acked-by: Laszlo Ersek Tested-by: Laszlo Ersek Reviewed-by: Feng Tian --- UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'UefiCpuPkg') 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; } } } -- cgit v1.2.3