]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UefiCpuPkg/PiSmmCpuDxeSmm: Clear some semaphores on S3 boot path
authorJeff Fan <jeff.fan@intel.com>
Tue, 29 Nov 2016 07:48:32 +0000 (15:48 +0800)
committerJeff Fan <jeff.fan@intel.com>
Thu, 1 Dec 2016 07:22:02 +0000 (15:22 +0800)
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>
UefiCpuPkg/PiSmmCpuDxeSmm/MpService.c

index cfbf59e8f2cae5f377fe5c9202c46fc3e790890e..a873b68c30022b3686076eec062c0cdd4a8d613a 100644 (file)
@@ -1357,6 +1357,9 @@ InitializeMpSyncData (
         (UINT32 *)((UINTN)mSmmCpuSemaphores.SemaphoreCpu.Run + mSemaphoreSize * CpuIndex);\r
       mSmmMpSyncData->CpuData[CpuIndex].Present =\r
         (BOOLEAN *)((UINTN)mSmmCpuSemaphores.SemaphoreCpu.Present + mSemaphoreSize * CpuIndex);\r
+      *(mSmmMpSyncData->CpuData[CpuIndex].Busy)    = 0;\r
+      *(mSmmMpSyncData->CpuData[CpuIndex].Run)     = 0;\r
+      *(mSmmMpSyncData->CpuData[CpuIndex].Present) = FALSE;\r
     }\r
   }\r
 }\r