]> Git Repo - qemu.git/commitdiff
spapr: Don't request to unplug the same core twice
authorGreg Kurz <[email protected]>
Wed, 23 Oct 2019 19:17:40 +0000 (21:17 +0200)
committerDavid Gibson <[email protected]>
Wed, 23 Oct 2019 22:37:54 +0000 (09:37 +1100)
We must not call spapr_drc_detach() on a detached DRC otherwise bad things
can happen, ie. QEMU hangs or crashes. This is easily demonstrated with
a CPU hotplug/unplug loop using QMP.

Signed-off-by: Greg Kurz <[email protected]>
Message-Id: <157185826035.3073024.1664101000438499392[email protected]>
Signed-off-by: David Gibson <[email protected]>
hw/ppc/spapr.c

index f9410d390a071a217156a045cbea6e7f97625602..94f9d27096af542585caff998ed64c157b9309e8 100644 (file)
@@ -3741,9 +3741,10 @@ void spapr_core_unplug_request(HotplugHandler *hotplug_dev, DeviceState *dev,
                           spapr_vcpu_id(spapr, cc->core_id));
     g_assert(drc);
 
-    spapr_drc_detach(drc);
-
-    spapr_hotplug_req_remove_by_index(drc);
+    if (!spapr_drc_unplug_requested(drc)) {
+        spapr_drc_detach(drc);
+        spapr_hotplug_req_remove_by_index(drc);
+    }
 }
 
 int spapr_core_dt_populate(SpaprDrc *drc, SpaprMachineState *spapr,
This page took 0.033092 seconds and 4 git commands to generate.