Where did you get that? Both the UEFI PI and the EDK header states that StartupThisAP() can be executed in non-blocking mode, when the BSP is not supposed to wait for the function to return.Octocontrabass wrote:The function pointer you pass to StartupThisAP() must be to a function that returns. Said function must return before you call ExitBootServices().
There's absolutely nothing about the function must return before ExitBootServices (it just states that MP Services cannot be called after ExitBootServices). UEFI PI section "Non-Blocking Execution Support" on page 2-191 mentions nothing about the function returning. It only mentions using SingalEvent when timeout occurs, that's all (however it also mentions that zero timeout means infinity, aka no signal).If WaitEvent is NULL, execution is in blocking mode. The BSP waits until the AP finishes or TimeoutInMicroSecondss expires. Otherwise, execution is in non-blocking mode. BSP proceeds to the next task without waiting for the AP.
The whole point of MP Services is to provide a platform independent way of initializing the APs, from MpService.h:Octocontrabass wrote:Using INIT and STARTUP IPIs after calling ExitBootServices().
Code: Select all
MP Services Protocol is hardware-independent. Most of the logic of this protocol
is architecturally neutral. It abstracts the multi-processor environment and
status of processors, and provides interfaces to retrieve information, maintain,
and dispatch.
Another question, STARTUP IPI requires a code block under 1M for real mode startup. How can you allocate a memory for that, when UEFI is managing the memory? How can you tell AllocPages (or any other UEFI memory allocation function) that you need a page that's below 1M? How can you be sure that there's any free memory left below 1M at all? This makes no sense. From the doc:
Cheers,Caution: Although the Allocate services allow for specific memory allocation, do not allocate specific addresses in a UEFI driver. Allocating buffers at a specific address could result in errors, including a catastrophic failure on some platforms.
bzt