From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Gibson Subject: Re: [kvm-unit-tests PATCH v6 17/18] powerpc/ppc64: add RTAS support Date: Mon, 22 Feb 2016 18:56:10 +1100 Message-ID: <20160222075610.GK2808@voom.fritz.box> References: <1455897503-11835-1-git-send-email-drjones@redhat.com> <1455897503-11835-18-git-send-email-drjones@redhat.com> <20160222032628.GE2808@voom.fritz.box> <56CABB44.5070804@redhat.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3MHXEHrrXKLGx71o" Cc: Andrew Jones , 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: Thomas Huth Return-path: Received: from ozlabs.org ([103.22.144.67]:53473 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751166AbcBVHzN (ORCPT ); Mon, 22 Feb 2016 02:55:13 -0500 Content-Disposition: inline In-Reply-To: <56CABB44.5070804@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: --3MHXEHrrXKLGx71o Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 22, 2016 at 08:39:48AM +0100, Thomas Huth wrote: > 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 > ... > >> + > >> +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? >=20 > 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. Ah, ok. --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --3MHXEHrrXKLGx71o Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJWyr8ZAAoJEGw4ysog2bOSXZMQAMFMNZprOtbDBcp2e3+M81hZ nwFzVHXP2DlMM3YLkaVFOP0kA/e2+CCAhb9wuRpJypn7HBcCp0X+oIhmy4CXp2z8 5+B0H5vcFRxLmG4WCYTVmEIJyQ3sOAvU2Bs129aA1g7tHVvcaYXora1dEvjBjPvo r01mS0EczziyBnv8l1CvqfOGTn62W7dPv+SfNEt5Ec1p2XpkTE3lPtdgK364r53o iiLpbAX6BPyerfgOaxh8ppeL9MIoXqtQpmhiYjVweE6k1baX1GIxNrhR0SRcVdkH p8rnSAJZyynPMqNG7onS7GVs44iBVW/HJxmNRp1Wg14KQq7JXgcmhHs3MuO2A69E fp1HhlGdyvxq6LqE/2zYMuHsaxUFXJm0MdpSIvEbAtwH605p2cKWCq9eSFJRIAIz 3gYGKzA4AlVeYiVDibOxSG7rGalFZs0GR2gfXIsl/V5eylEAFJtqaCM1widJ/GQL cOr/jTq+igoTdt//WFGPlKg3ByHzmwumoFgj1ErEhXxR5qKGwVs18eSHKrLV9eTY FOPTaYJavKehdH4zrhD26cW8/TuwZva8j6DRuLcr5kdGojKkjJB3+Bs1Xp8OgiBd Y5JywtThtwivEsNT5iO+YWgiKtIYB3Hjdz8QM5ZlOCjPgX9zNuNYwEAyQmLxPapN TUT0s0psmL2cYG4FF+kH =DnEU -----END PGP SIGNATURE----- --3MHXEHrrXKLGx71o--