From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46791) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWG2K-000087-OH for qemu-devel@nongnu.org; Wed, 17 Feb 2016 23:17:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aWG2H-0008LO-RI for qemu-devel@nongnu.org; Wed, 17 Feb 2016 23:17:52 -0500 From: David Gibson Date: Thu, 18 Feb 2016 15:18:47 +1100 Message-Id: <1455769127-26005-27-git-send-email-david@gibson.dropbear.id.au> In-Reply-To: <1455769127-26005-1-git-send-email-david@gibson.dropbear.id.au> References: <1455769127-26005-1-git-send-email-david@gibson.dropbear.id.au> Subject: [Qemu-devel] [PULL 26/26] hw/ppc/spapr: Halt CPU when powering off via RTAS call List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: peter.maydell@linaro.org Cc: Thomas Huth , aik@ozlabs.ru, mark.cave-ayland@ilande.co.uk, agraf@suse.de, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, David Gibson From: Thomas Huth 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 Tested-by: Andrew Jones Signed-off-by: David Gibson --- hw/ppc/spapr_rtas.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c index 07ad672..b7c5ebd 100644 --- a/hw/ppc/spapr_rtas.c +++ b/hw/ppc/spapr_rtas.c @@ -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); } -- 2.5.0