Received: from eggs.gnu.org ([2001:4830:134:3::10]:48326) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWYyd-0008Q7-Ed for qemu-devel@nongnu.org; Thu, 18 Feb 2016 19:31:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aWYyc-0005Rb-17 for qemu-devel@nongnu.org; Thu, 18 Feb 2016 19:31:19 -0500 Date: Fri, 19 Feb 2016 11:16:41 +1100 From: David Gibson Message-ID: <20160219001641.GQ15224@voom.fritz.box> References: <1455829298-15331-1-git-send-email-thuth@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="1MCZUn4MZNv/LeVo" Content-Disposition: inline In-Reply-To: <1455829298-15331-1-git-send-email-thuth@redhat.com> Subject: Re: [Qemu-devel] [PATCH] ppc/kvm: Use error_report() instead of cpu_abort() for user-triggerable errors List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thomas Huth Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, agraf@suse.de --1MCZUn4MZNv/LeVo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Feb 18, 2016 at 10:01:38PM +0100, Thomas Huth wrote: > Setting the KVM_CAP_PPC_PAPR capability can fail if either the KVM > kernel module does not support it, or if the specified vCPU type > is not a 64-bit Book3-S CPU type. For example, the user can trigger > it easily with "-M pseries -cpu G2leLS" when using the kvm-pr kernel > module. So the error should not be reported with cpu_abort() since > this function is rather meant for reporting programming errors than > reporting user-triggerable errors (it prints out all CPU registers > and then calls abort() to kills the program - two things that the > normal user does not expect here) . So let's use error_report() with > exit(1) here instead. > A similar problem exists in the code that sets the KVM_CAP_PPC_EPR > capability, so while we're at it, fix that, too. >=20 > Signed-off-by: Thomas Huth Applied to ppc-for-2.6, thanks. > --- > target-ppc/kvm.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) >=20 > diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c > index 70ca296..762d6cf 100644 > --- a/target-ppc/kvm.c > +++ b/target-ppc/kvm.c > @@ -23,6 +23,7 @@ > #include > =20 > #include "qemu-common.h" > +#include "qemu/error-report.h" > #include "qemu/timer.h" > #include "sysemu/sysemu.h" > #include "sysemu/kvm.h" > @@ -1993,7 +1994,8 @@ void kvmppc_set_papr(PowerPCCPU *cpu) > =20 > ret =3D kvm_vcpu_enable_cap(cs, KVM_CAP_PPC_PAPR, 0); > if (ret) { > - cpu_abort(cs, "This KVM version does not support PAPR\n"); > + error_report("This vCPU type or KVM version does not support PAP= R"); > + exit(1); > } > =20 > /* Update the capability flag so we sync the right information > @@ -2013,7 +2015,8 @@ void kvmppc_set_mpic_proxy(PowerPCCPU *cpu, int mpi= c_proxy) > =20 > ret =3D kvm_vcpu_enable_cap(cs, KVM_CAP_PPC_EPR, 0, mpic_proxy); > if (ret && mpic_proxy) { > - cpu_abort(cs, "This KVM version does not support EPR\n"); > + error_report("This KVM version does not support EPR"); > + exit(1); > } > } > =20 --=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 --1MCZUn4MZNv/LeVo Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJWxl7pAAoJEGw4ysog2bOSHY4QAJ+A7QV3lihV1W/hCTnGnuih FGsYQt5isbe1hH6uyo+CPQ/As7Z20DMfA+EZYiOjpZnDglDMITKT/NKKthwERigm cwC2b1x937mnOQfsKVWtuMLJI64h0KYa/BNiLV8abYV2bIu+oWnt1SkvK/VzXXKe 8a9Z23u22UsWmOTQt6DeQZnTS00hMiTQYbGLMn7xvBkxpuXG7+/HQ1KPXg3m4lSd e79fyz90ObRT1mhwleUf1d6kVuVhcrPeoFDikoGYSBQccU342c6Ouir/FpNulIzP GueTDniiaCJfL6ZKc6fbk6HduE6xrq5cS+u4zU6psgpFLW8+O1EYEor8g8i+qpOV //QpDpH+jnnOY2Y0qgSgRcLJvsUccKNu4hSnE7AdzQAf8SOsbeLiqTcSBVD3YrYl qVc5IkyUWnF7Do/kjSyb2M7c9NbIpHHwF1hTjp3QrtviHMWxwprkANBZY19DoDud uXolRN5KCtOmU/0bQUk0t78f80uOP1qcRaTxtCrUKqFsoIxkbE4TL622i3m8+u0E 0ujJeBcJe5OrBHoafdOsrFfnU19qwA+UHbrQAU091/8qbyg6Ol3h63wetMiCp0eR 8e8Bgan6LQf7lEP3dSJjioeft0G5o6NQMy8Ud5arRZBO9DuZcJotIgrfszK7CKEr JidlYfV8djgoSe5YLp2Q =Ahuy -----END PGP SIGNATURE----- --1MCZUn4MZNv/LeVo--