-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
Is there an existing issue for this?
- I have searched existing issues
Bug Type
- Firmware
- Tool
- Unit Test
What packages are impacted?
UefiCpuPkg
Which targets are impacted by this bug?
DEBUG, RELEASE
Current Behavior
If AP loop mode is not Halt loop, it is found that the AP in ApInitDone state exits 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.
For example, the related code in WakeUpAp function is as follow.
WakeUpAP ()
{
...
} else {
...
//
// Wakeup specified AP
//
ASSERT (CpuMpData->InitFlag == ApInitDone);
*(UINT32 *)CpuData->StartupApSignal = WAKEUP_AP_SIGNAL;
if (ResetVectorRequired) {
...
} else {
SendInitSipiSipi (
CpuInfoInHob[ProcessorNumber].ApicId,
(UINT32)ExchangeInfo->BufferStart
);
}
}
//
// Wait specified AP waken up
//
WaitApWakeup (CpuData->StartupApSignal);
}
if (ResetVectorRequired) {
FreeResetVector (CpuMpData);
}
...
}
Expected Behavior
To ensure AP wake up, it is expected that the AP is in the known non-executable state before the AP wakeup signal.
Steps To Reproduce
- Boot to EFI shell
- Run an MP test tool that enables and disables all APs sequentially through the following service
gEfiMpServiceProtocolGuid->EnableDisableAP service - The error was detected by the stress test (e.g. 10000 times) in the tool
Build Environment
- OS(s): EFI Shell
- Tool Chain(s): VS2022
Version Information
Tag: edk2-stable202505
Urgency
Medium
Are you going to fix this?
I will fix it
Do you need maintainer feedback?
Maintainer feedback requested
Anything else?
I have committed the following PR that fixes the issue. I have got some feedback from EDK2 maintainers.
At this point, I am requesting EDK2 maintainers to review the latest version on the feedback.