Skip to content

Commit

Permalink
OvmfPkg/CpuHotplugSmm: delay SMM exit
Browse files Browse the repository at this point in the history
Let APs wait until the BSP has completed the register updates to remove
the CPU.  This makes sure all APs stay in SMM mode until the CPU
hot-unplug operation is complete, which in turn makes sure the ACPI lock
is released only after the CPU hot-unplug operation is complete.

Some background:  The CPU hotplug SMI is triggered from an ACPI function
which is protected by an ACPI lock.  The ACPI function is in the ACPI
tables generated by qemu.

Signed-off-by: Gerd Hoffmann <[email protected]>
  • Loading branch information
kraxel authored and mergify[bot] committed Sep 13, 2024
1 parent ec18fa8 commit 121af96
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions OvmfPkg/CpuHotplugSmm/CpuHotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,11 @@ EjectCpu (
//
QemuSelector = mCpuHotEjectData->QemuSelectorMap[ProcessorNum];
if (QemuSelector == CPU_EJECT_QEMU_SELECTOR_INVALID) {
/* wait until BSP is done */
while (mCpuHotEjectData->Handler != NULL) {
CpuPause ();
}

return;
}

Expand Down

0 comments on commit 121af96

Please sign in to comment.