hw/ppc/spapr: Halt CPU when powering off via RTAS call
authorThomas Huth <thuth@redhat.com>
Wed, 17 Feb 2016 18:23:19 +0000 (19:23 +0100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Thu, 18 Feb 2016 00:08:43 +0000 (11:08 +1100)
The LoPAPR specification defines the following for the RTAS
power-off call: "On successful operation, does not return".
However, the implementation in QEMU currently returns and runs
the guest CPU again for some more cycles. This caused some
trouble with the new ppc implementation of the kvm-unit-tests
recently. So let's make sure that the QEMU implementation
follows the spec, thus stop the CPU to make sure that the
RTAS call does not return to the guest anymore.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Tested-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/ppc/spapr_rtas.c

index 07ad672e5a6510470c58ee75afc17f6b79285724..b7c5ebde4002fe9c38f9f20ffcbfcd73b2dd620b 100644 (file)
@@ -113,6 +113,7 @@ static void rtas_power_off(PowerPCCPU *cpu, sPAPRMachineState *spapr,
         return;
     }
     qemu_system_shutdown_request();
+    cpu_stop_current();
     rtas_st(rets, 0, RTAS_OUT_SUCCESS);
 }