From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ISO-8859-1?Q?Andreas_F=E4rber?= Subject: Re: [Qemu-devel] [PATCH] kvm: Set default accelerator to "kvm" if the host supports it Date: Mon, 08 Oct 2012 16:03:08 +0200 Message-ID: <5072DD1C.9060808@suse.de> References: <20120930191146.GA20012@amt.cnet> <50694EC1.8060006@siemens.com> <20121001093102.GA14797@amt.cnet> <50696E9E.7030302@siemens.com> <87zk468h3y.fsf@codemonkey.ws> <50699CDC.1010604@redhat.com> <87wqzap9ui.fsf@codemonkey.ws> <5069A9DF.4040606@siemens.com> <87wqza2mg6.fsf@codemonkey.ws> <7F16819A-D454-4412-A21D-CD6185C8D505@suse.de> <87pq4xhdbc.fsf@codemonkey.ws> <9F3F356B-1A5A-44A8-A9D4-9CE9E4C61A8F@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Anthony Liguori , Peter Maydell , Blue Swirl , kvm , Scott Moser , Jan Kiszka , Marcelo Tosatti , Michael Tokarev , qemu-devel , Avi Kivity , Cole Robinson , Paolo Bonzini , Aurelien Jarno To: Alexander Graf Return-path: Received: from cantor2.suse.de ([195.135.220.15]:57506 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750834Ab2JHODP (ORCPT ); Mon, 8 Oct 2012 10:03:15 -0400 In-Reply-To: <9F3F356B-1A5A-44A8-A9D4-9CE9E4C61A8F@suse.de> Sender: kvm-owner@vger.kernel.org List-ID: Am 05.10.2012 04:24, schrieb Alexander Graf: >=20 > On 05.10.2012, at 04:17, Anthony Liguori wrote: >=20 >> Alexander Graf writes: >> >>> On 03.10.2012, at 22:26, Peter Maydell wrote: >>> >>>> On 3 October 2012 21:01, Blue Swirl wrote: >>>>> On Mon, Oct 1, 2012 at 4:20 PM, Anthony Liguori wrote: >>>>>> Jan Kiszka writes: >>>>>>> + /* The default accelerator depends on the availability= of KVM. */ >>>>>>> + p =3D kvm_configured ? "kvm" : "tcg"; >>>>>>> } >>>> >>>>>> Blue/Aurelien, any objections? >>>>> >>>>> No, maybe a message could be printed that says that the default h= as >>>>> changed, for a few releases. >>>> >>>> I've lost track of the conversation, are we currently proposing >>>> the accelerator default to be "kvm" (as per the original patch >>>> you quote here) or "kvm:tcg" ? >>>> >>>> I'm not entirely sure which I prefer from an ARM perspective >>>> For some time to come and for a lot of targets (ie any target >>>> CPU except A15), having a default of "kvm" is going to cause >>>> existing working commandlines to stop working. [I expect that >>>> ARM-host qemu binaries will be built with CONFIG_KVM once ARM >>>> KVM support lands, but the same binary will be run on hosts >>>> without virtualization extensions.] On the other hand, perhaps >>>> there just aren't really very many people who run QEMU on >>>> ARM hosts, and so we can ignore them :-) >>> >>> We get similar problems on PPC. Take the following example: >>> >>> $ qemu-system-ppc -M mpc8544ds -kernel uImage -nographic >> >> But do you really expect people to do this? I have to believe that >> people running on PPC hardware and running qemu-system-ppc most like= ly >> want to do KVM... >=20 > Sure. But we wouldn't be able to even tell them what went wrong, as w= e don't have a negotiation mechanism right now that could tell user spa= ce "hey, the CPU you selected is unknown to me". Would it help to split out the cpu_model -> CPUClass lookup from cpu_ppc_init() to invoke a hook or inquire a field indicating KVM suppo= rt? Andreas >=20 > However, if during cpu init we could add such a check and then fall b= ack to tcg mode if accel=3Dkvm:tcg with a warning, that'd be nice user = experience. >=20 > We could do the same for ARM. If you do -M beagle on an A15 KVM enabl= ed machine, you would still be able to do so, but KVM tells you it can'= t emulate an A8 right now. And if in the future KVM learns how to expos= e an A8 on A15, we could just not bail out and things would magically w= ork. >=20 > Apart from that, I like the idea of kvm:tcg with a warning as the def= ault for qemu. We should still have a qemu-kvm binary in the distro tha= t does accel=3Dkvm so people don't accidentally fall back to tcg mode. >=20 >=20 > Alex >=20 --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrn= berg From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:45415) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TLDvh-0007en-2z for qemu-devel@nongnu.org; Mon, 08 Oct 2012 10:03:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TLDvP-0000sl-D3 for qemu-devel@nongnu.org; Mon, 08 Oct 2012 10:03:32 -0400 Received: from cantor2.suse.de ([195.135.220.15]:57501 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TLDvP-0000sV-3e for qemu-devel@nongnu.org; Mon, 08 Oct 2012 10:03:15 -0400 Message-ID: <5072DD1C.9060808@suse.de> Date: Mon, 08 Oct 2012 16:03:08 +0200 From: =?ISO-8859-1?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <20120930191146.GA20012@amt.cnet> <50694EC1.8060006@siemens.com> <20121001093102.GA14797@amt.cnet> <50696E9E.7030302@siemens.com> <87zk468h3y.fsf@codemonkey.ws> <50699CDC.1010604@redhat.com> <87wqzap9ui.fsf@codemonkey.ws> <5069A9DF.4040606@siemens.com> <87wqza2mg6.fsf@codemonkey.ws> <7F16819A-D454-4412-A21D-CD6185C8D505@suse.de> <87pq4xhdbc.fsf@codemonkey.ws> <9F3F356B-1A5A-44A8-A9D4-9CE9E4C61A8F@suse.de> In-Reply-To: <9F3F356B-1A5A-44A8-A9D4-9CE9E4C61A8F@suse.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] kvm: Set default accelerator to "kvm" if the host supports it List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: Peter Maydell , kvm , Scott Moser , Jan Kiszka , Marcelo Tosatti , Michael Tokarev , qemu-devel , Blue Swirl , Avi Kivity , Anthony Liguori , Cole Robinson , Paolo Bonzini , Aurelien Jarno Am 05.10.2012 04:24, schrieb Alexander Graf: >=20 > On 05.10.2012, at 04:17, Anthony Liguori wrote: >=20 >> Alexander Graf writes: >> >>> On 03.10.2012, at 22:26, Peter Maydell wrote: >>> >>>> On 3 October 2012 21:01, Blue Swirl wrote: >>>>> On Mon, Oct 1, 2012 at 4:20 PM, Anthony Liguori wrote: >>>>>> Jan Kiszka writes: >>>>>>> + /* The default accelerator depends on the availability o= f KVM. */ >>>>>>> + p =3D kvm_configured ? "kvm" : "tcg"; >>>>>>> } >>>> >>>>>> Blue/Aurelien, any objections? >>>>> >>>>> No, maybe a message could be printed that says that the default has >>>>> changed, for a few releases. >>>> >>>> I've lost track of the conversation, are we currently proposing >>>> the accelerator default to be "kvm" (as per the original patch >>>> you quote here) or "kvm:tcg" ? >>>> >>>> I'm not entirely sure which I prefer from an ARM perspective >>>> For some time to come and for a lot of targets (ie any target >>>> CPU except A15), having a default of "kvm" is going to cause >>>> existing working commandlines to stop working. [I expect that >>>> ARM-host qemu binaries will be built with CONFIG_KVM once ARM >>>> KVM support lands, but the same binary will be run on hosts >>>> without virtualization extensions.] On the other hand, perhaps >>>> there just aren't really very many people who run QEMU on >>>> ARM hosts, and so we can ignore them :-) >>> >>> We get similar problems on PPC. Take the following example: >>> >>> $ qemu-system-ppc -M mpc8544ds -kernel uImage -nographic >> >> But do you really expect people to do this? I have to believe that >> people running on PPC hardware and running qemu-system-ppc most likely >> want to do KVM... >=20 > Sure. But we wouldn't be able to even tell them what went wrong, as we = don't have a negotiation mechanism right now that could tell user space "= hey, the CPU you selected is unknown to me". Would it help to split out the cpu_model -> CPUClass lookup from cpu_ppc_init() to invoke a hook or inquire a field indicating KVM support= ? Andreas >=20 > However, if during cpu init we could add such a check and then fall bac= k to tcg mode if accel=3Dkvm:tcg with a warning, that'd be nice user expe= rience. >=20 > We could do the same for ARM. If you do -M beagle on an A15 KVM enabled= machine, you would still be able to do so, but KVM tells you it can't em= ulate an A8 right now. And if in the future KVM learns how to expose an A= 8 on A15, we could just not bail out and things would magically work. >=20 > Apart from that, I like the idea of kvm:tcg with a warning as the defau= lt for qemu. We should still have a qemu-kvm binary in the distro that do= es accel=3Dkvm so people don't accidentally fall back to tcg mode. >=20 >=20 > Alex >=20 --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg