Received: from eggs.gnu.org ([2001:4830:134:3::10]:48324) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aWYyd-0008Q2-DF 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-0005Rn-6q for qemu-devel@nongnu.org; Thu, 18 Feb 2016 19:31:19 -0500 Date: Fri, 19 Feb 2016 11:17:27 +1100 From: David Gibson Message-ID: <20160219001727.GR15224@voom.fritz.box> References: <1455829316-15382-1-git-send-email-thuth@redhat.com> <56C64220.2020903@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="U5J2I87mWnf1KeOw" Content-Disposition: inline In-Reply-To: <56C64220.2020903@redhat.com> Subject: Re: [Qemu-devel] [PATCH] ppc/kvm: Tell the user what might be wrong when using bad CPU types with kvm-hv List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: Thomas Huth , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, agraf@suse.de --U5J2I87mWnf1KeOw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Feb 18, 2016 at 03:13:52PM -0700, Eric Blake wrote: > On 02/18/2016 02:01 PM, Thomas Huth wrote: > > Using a CPU type that does not match the host is not possible when using > > the kvm-hv kernel module - the PVR is checked in the kernel function > > kvm_arch_vcpu_ioctl_set_sregs_hv() and rejected with -EINVAL if it > > does not match the host. > > However, when the user tries to specify a non-matching CPU type, QEMU > > currently only reports "kvm_init_vcpu failed: Invalid argument", and > > this is of course not very helpful for the user to solve the problem. > > So this patch adds a more descriptive error message that tells the > > user to specify "-cpu host" instead. > >=20 > > Signed-off-by: Thomas Huth > > --- > > target-ppc/kvm.c | 4 ++++ > > 1 file changed, 4 insertions(+) > >=20 > > diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c > > index 762d6cf..6545fbe 100644 > > --- a/target-ppc/kvm.c > > +++ b/target-ppc/kvm.c > > @@ -513,6 +513,10 @@ int kvm_arch_init_vcpu(CPUState *cs) > > /* Synchronize sregs with kvm */ > > ret =3D kvm_arch_sync_sregs(cpu); > > if (ret) { > > + if (ret =3D=3D -EINVAL) { > > + error_report("Register sync failed... If you're using kvm-= hv.ko," > > + " only \"-cpu host\" is possible!"); >=20 > No need to shout at the user; drop the trailing ! Applied to ppc-for-2.6 with ! removed. Thanks. --=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 --U5J2I87mWnf1KeOw Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJWxl8XAAoJEGw4ysog2bOSmsIP/2KLD8UT3M7E7CrVC8iSAMBg wg6BAYpw8Kbh3c8mTa67Ed+imANcWMVRE4O9AKU3QGaLjUUHhOX+4y9bo+ujCIpf RgiXsSqYVnlDjwBVYx9d+hRmKL66BG7/TqCtkbdGv3FG8+uzvirWF1wQHXwJRH1D oJnwkU3a8eJADClDSN1s5l7/xXiqpRRNeoTwbjx/BSl8yNnZyek1uFt00Bzf/Irn 6eaYNb3A0nKUwIVNhFEpD7iU2eQyjBWsEYyr64wkwQd/BKmD5zfDCm8Hvv6uaS/7 Mz/4NN9LfgotvzUD9hnsl2lk3+srmIHvMHF/PHdgpCjIAS1zeN/C2dtLDHymTwvc GpXCQqjr9xsB3A6+diuzN+cMSRE1COMMMig2nYvFTH3V5ab11ylve9eig8RuEoqC C5y9kKaqW/PXTJQyz6ESZWnkvxpN7HPWaxfMIb1HalBbmrr7JZu9yZObrZr+CBP5 tG576O0RvhtsdhEQ4DU9rN47JuBfnUfzavCRBr98podKzlSsrovnj08gw/wbUrcM gIXv+K+QG72ez/nPxl+ZLu7bVjquOSVUNNceFPns65RAsFUQCn67fpRrQHlo81Uv ZBCw5Arx7YaVdjIOtVLZuDqJU6YCY5djjMKBun43xb09XRfjK1KgWqcWD1RaiFTQ rI3hs5PYNiAg5s9rA+vW =VxC/ -----END PGP SIGNATURE----- --U5J2I87mWnf1KeOw--