Branch: refs/heads/master
Home: https://github.com/tianocore/edk2
Commit: 74c687cc2f2f29d3bdd454a416624f0ca5a86566
https://github.com/tianocore/edk2/commit/74c687cc2f2f29d3bdd454a416624f0ca5a86566
Author: Yuanhao Xie <[email protected]>
Date: 2023-10-26 (Thu, 26 Oct 2023)
Changed paths:
M UefiCpuPkg/Library/MpInitLib/MpLib.c
Log Message:
-----------
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 <[email protected]>
Cc: Ray Ni <[email protected]>
Cc: Eric Dong <[email protected]>
Cc: Rahul Kumar <[email protected]>
Cc: Tom Lendacky <[email protected]>
Message-Id: <[email protected]>
Reviewed-by: Laszlo Ersek <[email protected]>
Regression-tested-by: Laszlo Ersek <[email protected]>
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits