From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [kvm-unit-tests PATCH] powerpc: Fix endless loop that occurs without a device tree Date: Tue, 30 May 2017 19:36:53 +0200 Message-ID: <1f121e1c-4b71-54e6-820e-11056aa13603@redhat.com> References: <1496156844-29196-1-git-send-email-thuth@redhat.com> <95e3bc86-10a7-8c4e-94d7-dee63c67be2d@redhat.com> <2d7b5b2e-3ea6-1203-9fdd-2d2ac047f159@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: rkrcmar@redhat.com, lvivier@redhat.com, kvm-ppc@vger.kernel.org To: Thomas Huth , kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:51158 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750898AbdE3Rg6 (ORCPT ); Tue, 30 May 2017 13:36:58 -0400 In-Reply-To: <2d7b5b2e-3ea6-1203-9fdd-2d2ac047f159@redhat.com> Content-Language: en-US Sender: kvm-owner@vger.kernel.org List-ID: On 30/05/2017 18:13, Thomas Huth wrote: > On 30.05.2017 17:19, Paolo Bonzini wrote: >> >> >> On 30/05/2017 17:07, Thomas Huth wrote: >>> , NULL, -1, -1); >>> + int token, ret; >>> + >>> + token = rtas_token("power-off"); >>> + if (token < 0) { >>> + puts("RTAS power-off not available\n"); >>> + return; >>> + } >> >> Should this do some kind of infinite loop (Linux arch/x86 has play_dead >> which does cli;hlt, not sure if there's something similar for sPAPR)? > > The exit() function in lib/powerpc/io.c already calls halt() after > trying to run rtas_power_off() ... I think that should be enough here. Indeed, thanks! Paolo From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Date: Tue, 30 May 2017 17:36:53 +0000 Subject: Re: [kvm-unit-tests PATCH] powerpc: Fix endless loop that occurs without a device tree Message-Id: <1f121e1c-4b71-54e6-820e-11056aa13603@redhat.com> List-Id: References: <1496156844-29196-1-git-send-email-thuth@redhat.com> <95e3bc86-10a7-8c4e-94d7-dee63c67be2d@redhat.com> <2d7b5b2e-3ea6-1203-9fdd-2d2ac047f159@redhat.com> In-Reply-To: <2d7b5b2e-3ea6-1203-9fdd-2d2ac047f159@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Thomas Huth , kvm@vger.kernel.org Cc: rkrcmar@redhat.com, lvivier@redhat.com, kvm-ppc@vger.kernel.org On 30/05/2017 18:13, Thomas Huth wrote: > On 30.05.2017 17:19, Paolo Bonzini wrote: >> >> >> On 30/05/2017 17:07, Thomas Huth wrote: >>> , NULL, -1, -1); >>> + int token, ret; >>> + >>> + token = rtas_token("power-off"); >>> + if (token < 0) { >>> + puts("RTAS power-off not available\n"); >>> + return; >>> + } >> >> Should this do some kind of infinite loop (Linux arch/x86 has play_dead >> which does cli;hlt, not sure if there's something similar for sPAPR)? > > The exit() function in lib/powerpc/io.c already calls halt() after > trying to run rtas_power_off() ... I think that should be enough here. Indeed, thanks! Paolo