diff options
author | Yuanhao Xie <yuanhao.xie@intel.com> | 2023-10-25 19:42:16 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2023-10-26 17:43:03 +0000 |
commit | 74c687cc2f2f29d3bdd454a416624f0ca5a86566 (patch) | |
tree | d36110ef642769651d44bc1bfd8258aeea86439b /UefiCpuPkg/Library/MicrocodeLib | |
parent | fe43b426762c31c2f1958444d3aca388ec8d4702 (diff) | |
download | edk2-74c687cc2f2f29d3bdd454a416624f0ca5a86566.zip edk2-74c687cc2f2f29d3bdd454a416624f0ca5a86566.tar.gz edk2-74c687cc2f2f29d3bdd454a416624f0ca5a86566.tar.bz2 |
UefiCpuPkg/MpInitLib: Wait for all APs to finish initialization
Aim:
- To solve the assertion that checks if CpuMpData->FinishedCount
equals (CpuMpData->CpuCount - 1). The assertion arises from a timing
discrepancy between the BSP's completion of startup signal checks and
the APs' incrementation of the FinishedCount.
- This patch also ensures that "finished" reporting from the APs is as
later as possible.
More specifially:
In the SwitchApContext() function, the BSP trigers
the startup signal and check whether the APs have received it. After
completing this check, the BSP then verifies if the FinishedCount is
equal to CpuCount-1.
On the AP side, upon receiving the startup signal, they invoke
SwitchContextPerAp() and increase the FinishedCount to indicate their
activation. However, even when all APs have received the startup signal,
they might not have finished incrementing the FinishedCount. This timing
gap results in the triggering of the assertion.
Solution:
Instead of assertion, use while loop to waits until all the APs have
incremented the FinishedCount.
Fixes: 964a4f032dcd
Signed-off-by: Yuanhao Xie <yuanhao.xie@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Message-Id: <20231025114216.2824-1-yuanhao.xie@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
Diffstat (limited to 'UefiCpuPkg/Library/MicrocodeLib')
0 files changed, 0 insertions, 0 deletions