UefiCpuPkg/MpInitLib: Ensure AP wake up on WakeUpByInitSipiSipi mode #11215
+16
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If AP loop mode is not Halt loop, it is found that the AP in ApInitDone state exists the loop mode immediately when WAKEUP_AP_SIGNAL is signaled at the first step of AP wake up. When WakeUpByInitSipiSipi is enabled, it is possible that the AP could clear StartupApSignal buffer before the BSP sends Init-Startup IPI to the AP. In the case, it causes that the BSP frees AP reset vector buffer even though AP wake up is in process. This results in an exception error. To ensure AP wake up, it is expected that the AP is in the known non-executable state before the AP wakeup signal.
For example, the related code in WakeUpAp function is as follow.
How This Was Tested
The update has been verified on AMD platforms. We met the case/issue when testing an MP test tool for EFI shell. The tool enables and disables APs sequentially through gEfiMpServiceProtocolGuid->EnableDisableAP service. The error was detected by the stress test (e.g. 10000 times) in the tool. It fixes the issue.
Integration Instructions
N/A