]> git.proxmox.com Git - mirror_edk2.git/commit - UefiCpuPkg/CpuMpPei/CpuMpPei.c
UefiCpuPkg/CpuMpPei: Fix potential AP mwait wakeup issue
authorJeff Fan <jeff.fan@intel.com>
Thu, 31 Mar 2016 11:15:05 +0000 (19:15 +0800)
committerJeff Fan <jeff.fan@intel.com>
Mon, 11 Apr 2016 06:15:45 +0000 (14:15 +0800)
commit4da1ebf3b3c22ec3e09cef3fe5d1da6f40895e6d
treeff1272829484280143d8ac5f2752c7ac56242717
parent587d204ccda4b507be4f9f42e8c9d226fd755be0
UefiCpuPkg/CpuMpPei: Fix potential AP mwait wakeup issue

If ApLoopMode is set to ApInMwaitLoop, AP will be placed into C-State by mwait
instruction. BSP will wakeup AP by write start-up signal in monitor address.
However, AP maybe waken by SMI/NMI/MCE and other condition. On this case, AP
will check if BSP wants to wakeup itself really. If not, AP will continue to
execute mwait to C-State.

One potential issue: BSP may not recognize AP was wakeup from C-State by other
event and BSP still writes start-up signal to wakeup AP. But AP does not aware
it and still execute mwait instruction to C-State. So, AP cannot be wakeup on
this case.

This fix is let AP to clear start-up signal when it really is wakeup to execute
AP function. And BSP will write start-up signal till AP clears it.

Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
UefiCpuPkg/CpuMpPei/CpuMpPei.c