From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH 3/9] change order of kvm_init call. Date: Mon, 27 Jul 2009 20:10:24 +0200 Message-ID: <4A6DED90.3010200@web.de> References: <1248131416-11272-1-git-send-email-glommer@redhat.com> <1248131416-11272-2-git-send-email-glommer@redhat.com> <1248131416-11272-3-git-send-email-glommer@redhat.com> <1248131416-11272-4-git-send-email-glommer@redhat.com> <4A6CA7A0.8020901@web.de> <20090727173851.GC4776@poweredge.glommer> <4A6DE892.7050801@us.ibm.com> <20090727180003.GE4776@poweredge.glommer> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig76A05D2FFFBC506F8B2CC217" Cc: Anthony Liguori , kvm@vger.kernel.org, avi@redhat.com To: Glauber Costa Return-path: Received: from fmmailgate02.web.de ([217.72.192.227]:51101 "EHLO fmmailgate02.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752875AbZG0SK3 (ORCPT ); Mon, 27 Jul 2009 14:10:29 -0400 In-Reply-To: <20090727180003.GE4776@poweredge.glommer> Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig76A05D2FFFBC506F8B2CC217 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Glauber Costa wrote: > On Mon, Jul 27, 2009 at 12:49:06PM -0500, Anthony Liguori wrote: >> Glauber Costa wrote: >>> On Sun, Jul 26, 2009 at 08:59:44PM +0200, Jan Kiszka wrote: >>> =20 >>>> Glauber Costa wrote: >>>> =20 >>>>> The goal is to get rid of the call to kvm_init. But those things >>>>> are subtle, and often break. So do it in a separate patch, to help >>>>> finding potential issues in future bisections. >>>>> =20 >>>> Found such an issued: This patch triggers a segfault if no kvm modul= es >>>> are loaded and you start qemu without -no-kvm. Please have a look. >>>> >>>> Jan >>>> =20 >>> ok, the culprit seems to be a=20 >>> >>> if (kvm_enabled()) >>> return; >>> >>> in the beginning of code_gen_alloc. >>> >>> It is 7f3d0cbe, by Avi, and according to changelog, suggested by anth= ony. >>> I however, fail to realise the purpose of this optimization. For one = thing, >>> it totally dictates that kvm has absolutely to be enabled or disabled= prior >>> to this point. No mind changing later. Also, the real deal is to be a= ble >>> to compile out tcg entirely. The strategy of just disabling the code = gen >>> alloc is a minor nitpick that just papers over this. >>> =20 >> I agree with you in principle but I think reverting this papers over a= n =20 >> issue. >> >> Why are we touching code_gen_ptr when using KVM? Can someone post the= =20 >> full back trace? > we're not. >=20 > The issue happens exactly when the kvm modules are not loaded, then we'= re failing > to initialize kvm. However, in the patch that raised this issue, I'm mo= ving > KVM initialization to after this code path. And in qemu-kvm.git, kvm is= > enabled-by-default. So tcg code would think kvm is enabled and skip ini= tialization, > while kvm code will fail to really initialize itself later. >=20 > Result? Mayhem. >=20 I think we should simply resolves this the way upstream does: Do not start if modules are missing and -no-kvm is omitted - or even switch over to -enable-kvm as I think you already suggested in some other thread. Then we can either fail or succeed, but not fall back more or less silently. This falling back of qemu-kvm to tcg is a constant source of confusion anyway. Jan --------------enig76A05D2FFFBC506F8B2CC217 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.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAkpt7ZMACgkQniDOoMHTA+mF7wCdHWrnR+dIgGPEj4FY8VHeU3No dRIAoISIPnKBtLJB9icrrS4DNWxC0xL5 =0B6O -----END PGP SIGNATURE----- --------------enig76A05D2FFFBC506F8B2CC217--