From: Eduardo Habkost Subject: Re: [PATCH v2 0/6] target-i386: Make most CPU models work with "enforce" out of the box Date: Wed, 27 Aug 2014 13:08:45 -0300 Message-ID: <20140827160844.GK32084@thinpad.lan.raisama.net> References: <1408999550-20321-1-git-send-email-ehabkost@redhat.com> <53FC83F5.2090905@redhat.com> <20140826180107.GD32084@thinpad.lan.raisama.net> <53FDDEF3.2000705@redhat.com> <20140827140535.GG32084@thinpad.lan.raisama.net> <53FDEC52.5040909@redhat.com> <20140827154213.GH32084@thinpad.lan.raisama.net> <53FE0039.4070509@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Paolo Bonzini , qemu-devel@nongnu.org, kvm@vger.kernel.org, Aurelien Jarno To: Andreas =?iso-8859-1?Q?F=E4rber?= Return-path: Received: from mx1.redhat.com ([209.132.183.28]:52201 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750754AbaH0QJB (ORCPT ); Wed, 27 Aug 2014 12:09:01 -0400 Content-Disposition: inline In-Reply-To: <53FE0039.4070509@suse.de> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Aug 27, 2014 at 05:58:49PM +0200, Andreas F=E4rber wrote: > Am 27.08.2014 17:42, schrieb Eduardo Habkost: > > On Wed, Aug 27, 2014 at 04:33:54PM +0200, Paolo Bonzini wrote: > >> Il 27/08/2014 16:05, Eduardo Habkost ha scritto: > >>> On Wed, Aug 27, 2014 at 03:36:51PM +0200, Paolo Bonzini wrote: > >>>> Il 26/08/2014 20:01, Eduardo Habkost ha scritto: > >>>>> So maybe that's good news, as things can be simpler if we make = both TCG > >>>>> and KVM have similar behavior: > >>>>> > >>>>> * qemu64: a conservative default that should work out of the bo= x on > >>>>> most systems, for both TCG and KVM. That's already the curren= t status, > >>>>> we just need to document it. > >>>>> > >>>>> * -cpu host: for people who want every possible feature to be e= nabled > >>>>> (but without cross-version live-migration support). We can ea= sily add > >>>>> support for "-cpu host" to TCG, too. > >>>> > >>>> This means that "-cpu host" has different meanings in KVM and TC= G. Is > >>>> that an advantage or a disadvantage? > >>> > >>> It is the same meaning to me: "enable everything that's possible, > >>> considering what's provided by the underlying accelerator". The "= host" > >>> name is misleading, though, because on KVM it is close to the hos= t CPU, > >>> but on TCG it depends solely on TCG's capabilities. > >> > >> True. It's not very intuitive, but it is the same concept for pro= cessor > >> capabilities. > >> > >> Though for some leaves that do not correspond to processor capabil= ities, > >> "-cpu host" does set them to the host values. This is not just th= e > >> cache model, but also the family/model/stepping/vendor. > >> > >> For the TCG case, when running on a Nehalem it would be weird to s= ee a > >> Nehalem guest with SMAP or ADOX support... I'm not sure it would = even > >> work to have SVM with an Intel vendor. :) > >=20 > > In that case, the best family/model/stepping/vendor choice depends = on > > TCG capabilities (defined at compile time), not on the host CPU. > >=20 > > ...and that proves your point: if we aren't even using the host CPU > > family/model/stepping, calling it "-cpu host" doesn't make much sen= se. > > If it is so different from the host model, we can call it "qemu64" = (and > > do as you suggests below). >=20 > Might that be an opportunity to reconsider a -cpu best or so, > independent of its implementation, to avoid "host"? It depends on what you expect "-cpu best" to mean. I have seen differen= t meanings being proposed for it. IIRC, "best" was proposed to mean "choose the best one from the existin= g (predefined) CPU models", not "enable everything possible, not even looking at the CPU model table". Anyway, it makes sense to have a name for the "enable everything" mode (whatever it is), and simply make "qemu64" an alias to it when in TCG mode. (If we didn't have existing libvirt code assuming "qemu64" is always th= e default in QEMU, we could simply get rid of "qemu64" and use better names. We may get rid of "qemu64" later, but we need to provide a way for libvirt to stop using it, first.) --=20 Eduardo