]> xenbits.xensource.com Git - people/aperard/ovmf.git/commitdiff
OvmfPkg/CpuHotplugSmm: delay SMM exit
authorGerd Hoffmann <kraxel@redhat.com>
Thu, 29 Aug 2024 07:20:29 +0000 (09:20 +0200)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Fri, 13 Sep 2024 20:33:10 +0000 (20:33 +0000)
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>
OvmfPkg/CpuHotplugSmm/CpuHotplug.c

index d50416302677ec8616615cae7f37997cf96013fc..5af78211d343fa8c1df6afc4709dd85837ec4d66 100644 (file)
@@ -355,6 +355,11 @@ EjectCpu (
   //\r
   QemuSelector = mCpuHotEjectData->QemuSelectorMap[ProcessorNum];\r
   if (QemuSelector == CPU_EJECT_QEMU_SELECTOR_INVALID) {\r
+    /* wait until BSP is done */\r
+    while (mCpuHotEjectData->Handler != NULL) {\r
+      CpuPause ();\r
+    }\r
+\r
     return;\r
   }\r
 \r