From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Huth Subject: Re: [kvm-unit-tests PATCH v6 17/18] powerpc/ppc64: add RTAS support Date: Mon, 22 Feb 2016 08:39:48 +0100 Message-ID: <56CABB44.5070804@redhat.com> References: <1455897503-11835-1-git-send-email-drjones@redhat.com> <1455897503-11835-18-git-send-email-drjones@redhat.com> <20160222032628.GE2808@voom.fritz.box> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jIPORHH3T5CeFFUn3Fh9vaAMP6Ig8vqID" Cc: kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, dgibson@redhat.com, agraf@suse.de, lvivier@redhat.com, pbonzini@redhat.com, rkrcmar@redhat.com To: David Gibson , Andrew Jones Return-path: Received: from mx1.redhat.com ([209.132.183.28]:52516 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753627AbcBVHj5 (ORCPT ); Mon, 22 Feb 2016 02:39:57 -0500 In-Reply-To: <20160222032628.GE2808@voom.fritz.box> Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --jIPORHH3T5CeFFUn3Fh9vaAMP6Ig8vqID Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 22.02.2016 04:26, David Gibson wrote: > On Fri, Feb 19, 2016 at 04:58:22PM +0100, Andrew Jones wrote: >> Add enough RTAS support to start adding RTAS commands. Just add >> power-off for now. >> >> Signed-off-by: Andrew Jones >> Reviewed-by: Thomas Huth >> Tested-by: Laurent Vivier >> Reviewed-by: David Gibson >> --- >> lib/powerpc/asm/rtas.h | 26 +++++++++ >> lib/powerpc/io.c | 2 + >> lib/powerpc/rtas.c | 139 +++++++++++++++++++++++++++++++++++++++= +++++++++ >> lib/ppc64/asm/rtas.h | 1 + >> powerpc/Makefile.common | 1 + >> 5 files changed, 169 insertions(+) >> create mode 100644 lib/powerpc/asm/rtas.h >> create mode 100644 lib/powerpc/rtas.c >> create mode 100644 lib/ppc64/asm/rtas.h =2E.. >> + >> +void rtas_power_off(void) >> +{ >> + int ret =3D rtas_call(rtas_token("power-off"), 2, 1, NULL, -1, -1); >> + printf("RTAS power-off returned %d\n", ret); >=20 > abort here? No, that does not work ... there was an assert() in an earlier version of the patch here, and that did not work: assert() (and abort()) call exit() in kvm-unit-test land, and exit again calls rtas_power_off() again, so you end up with and endless recursive loop. But exit() calls halt() after calling rtas_power_off(), so it's ok if that function simply returns here. Thomas --jIPORHH3T5CeFFUn3Fh9vaAMP6Ig8vqID Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJWyrtHAAoJEC7Z13T+cC21CBsP/07vejGfnK7/XTIl9plsrZ7H L0VaNRxY3jrW1hUM/V7KM6GFX+CsDodaz47W8zM21BVfF/6LWeNp+6jWjN+T4v0R X+laawdCrzuOomSHZBqDZuQqprwudNNctxXek/SJPuxUiWW102THDailww1f4rHR gAcVHdlCuEDk6kLBdIUzOy4Zvyl23vF5/Uesnwh5/JO2umeapQ9xUYdQBC4kMja0 xisaWfGleMTsUUbokEp11RBvEi6qlnxgKfd6HTXkDaVoT8zTV9LCq4jwL8FXaB+x zsBS6SqgtY3ay3IEi3FMddctJRAiwwF/EuEcziodzX9NbHfZ56T9eCSYKEPsFOTa kEsBrr6MrwJTeIXhb+2Qry1Sh6UfTUI+PcoIlUjLUd2Obv5gXDHGBEhHSDDl8Ql/ HqJT0urvbwJkekCeYuq/9KB1vNpGfREq6fLziAp6q2QekCfE/i+iMacvXunlXcPW s7dKVUperPROvqCZTa3NW5a6P70prXthTJ7MXiQs12kbbF5sDA2UV7CGU+7bDilQ IevkD3ytVEwW8GZKCYJUn7+aCVZP947biFWSyClmcNNj1N7aFCOCj4rCilvk/I3Z ZSz/gNWyka2C1anRh9WXxg8igzsx9Qt/7H+Lny73CuF1NEfLlp8492+TNhva3eYT OG2faZLpYUCZpl/t3z1w =gXpX -----END PGP SIGNATURE----- --jIPORHH3T5CeFFUn3Fh9vaAMP6Ig8vqID--