diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2024-08-29 09:20:29 +0200 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2024-09-13 20:33:10 +0000 |
commit | 121af960e2ac152be2c441837595a4c6e2a143f5 (patch) | |
tree | 84005fca871c04ad79d42eecdb1f15da40636295 /OvmfPkg/CpuHotplugSmm | |
parent | ec18fa81d311663e24e9b9ad61b90b38862a1ea8 (diff) | |
download | edk2-121af960e2ac152be2c441837595a4c6e2a143f5.tar.gz edk2-121af960e2ac152be2c441837595a4c6e2a143f5.tar.bz2 edk2-121af960e2ac152be2c441837595a4c6e2a143f5.zip |
OvmfPkg/CpuHotplugSmm: delay SMM exit
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 <kraxel@redhat.com>
Diffstat (limited to 'OvmfPkg/CpuHotplugSmm')
-rw-r--r-- | OvmfPkg/CpuHotplugSmm/CpuHotplug.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/OvmfPkg/CpuHotplugSmm/CpuHotplug.c b/OvmfPkg/CpuHotplugSmm/CpuHotplug.c index d504163026..5af78211d3 100644 --- a/OvmfPkg/CpuHotplugSmm/CpuHotplug.c +++ b/OvmfPkg/CpuHotplugSmm/CpuHotplug.c @@ -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;
}
|