From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=51839 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PZo8w-0007Ks-Lw for qemu-devel@nongnu.org; Mon, 03 Jan 2011 12:24:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PZo8v-00034R-9l for qemu-devel@nongnu.org; Mon, 03 Jan 2011 12:24:26 -0500 Received: from fmmailgate01.web.de ([217.72.192.221]:53194) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PZo8u-000345-R7 for qemu-devel@nongnu.org; Mon, 03 Jan 2011 12:24:25 -0500 Message-ID: <4D220646.9090403@web.de> Date: Mon, 03 Jan 2011 18:24:22 +0100 From: Jan Kiszka MIME-Version: 1.0 References: <4ffa4f23bc93aa5af90d836986771bb6d9856bf9.1294043582.git.jan.kiszka@web.de> <4D21F464.1070807@redhat.com> <4D21FF48.70103@web.de> <4D220103.5070707@redhat.com> In-Reply-To: <4D220103.5070707@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigE23C77C57E53E2A2C869D453" Sender: jan.kiszka@web.de Subject: [Qemu-devel] Re: [PATCH v2 17/17] kvm: Drop dependencies on very old capabilities List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: Jan Kiszka , Marcelo Tosatti , qemu-devel@nongnu.org, kvm@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigE23C77C57E53E2A2C869D453 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Am 03.01.2011 18:01, Avi Kivity wrote: > On 01/03/2011 06:54 PM, Jan Kiszka wrote: >> Am 03.01.2011 17:08, Avi Kivity wrote: >> > On 01/03/2011 10:33 AM, Jan Kiszka wrote: >> >> From: Jan Kiszka >> >> >> >> COALESCED_MMIO, SYNC_MMU, EXT_CPUID, CLOCKSOURCE, NOP_IO_DELAY, >> PV_MMU - >> >> all these caps predate features on which we already depend at buil= d >> >> time. Moreover, the check for KVM_CAP_EXT_CPUID is unneeded as we >> >> already test& fail is a more recent feature is missing. >> > >> > No. Each test documents a dependency of qemu on a kvm feature. Ev= en >> > though something like SYNC_MMU is unlikely to go away, as long as w= e >> > depend on it, we require the feature. >> > >> >> Then at least move all those KVM_CAPs we need at build time into >> configure. >=20 > Need a run time check as well (build on new kernel, run on old kernel, > or run on even newer kernel that lost a feature). >=20 >> I really see no value in keeping ugly conditional code >> around, A) because those paths won't be tested and B) none of the CAPs= >> touched here are to pass away without a replacement that will require >> user space adaption anyway. >=20 > I'm fine with a series of checks during init time with no fallback. I'= m > not fine with just dropping those away. Reducing code size is great, > but not at the cost of undiagnosed runtime failures. My worry was not code size but untested code. And looking at the EXT_CPUID case again, this is what would happen: kvm_x86_get_supported_cpuid will return -1 if we lack EXT_CPUID, but that value is interpreted by the callers as "all requested features available" - likely not that helpful in all cases. This also affects qemu-kvm. I will add generic and per-arch check sections at build and runtime for CAPs we don't want to miss. Jan --------------enigE23C77C57E53E2A2C869D453 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.15 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/ iEYEARECAAYFAk0iBkYACgkQitSsb3rl5xQkRQCgu7VVvj94/9ayb3FgZCcszr2Q bIsAnReBhfmAdcRgs9OqAQJDw5ksVRVE =GMW0 -----END PGP SIGNATURE----- --------------enigE23C77C57E53E2A2C869D453--