From patchwork Wed Feb 17 18:23:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 8341981 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 74C969FC82 for ; Wed, 17 Feb 2016 18:23:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9EE5B20386 for ; Wed, 17 Feb 2016 18:23:39 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EEEFC20395 for ; Wed, 17 Feb 2016 18:23:38 +0000 (UTC) Received: from localhost ([::1]:60402 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aW6lF-0002rO-Vu for patchwork-qemu-devel@patchwork.kernel.org; Wed, 17 Feb 2016 13:23:38 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54039) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aW6l6-0002ql-C0 for qemu-devel@nongnu.org; Wed, 17 Feb 2016 13:23:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aW6l1-0001Ls-CQ for qemu-devel@nongnu.org; Wed, 17 Feb 2016 13:23:28 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44278) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aW6l1-0001LM-7J; Wed, 17 Feb 2016 13:23:23 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 0E820C000717; Wed, 17 Feb 2016 18:23:22 +0000 (UTC) Received: from thh440s.fritz.box (vpn1-4-89.ams2.redhat.com [10.36.4.89]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1HINJEd022809; Wed, 17 Feb 2016 13:23:20 -0500 From: Thomas Huth To: qemu-ppc@nongnu.org, david@gibson.dropbear.id.au Date: Wed, 17 Feb 2016 19:23:19 +0100 Message-Id: <1455733399-4939-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: drjones@redhat.com, qemu-devel@nongnu.org, agraf@suse.de Subject: [Qemu-devel] [PATCH] hw/ppc/spapr: Halt CPU when powering off via RTAS call X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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); }