Received: from eggs.gnu.org ([2001:4830:134:3::10]:47792) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W5e4V-0007jk-Du for qemu-devel@nongnu.org; Tue, 21 Jan 2014 11:21:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W5e4P-0006xx-DH for qemu-devel@nongnu.org; Tue, 21 Jan 2014 11:21:03 -0500 Received: from mx1.redhat.com ([209.132.183.28]:30154) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W5e4P-0006xc-4q for qemu-devel@nongnu.org; Tue, 21 Jan 2014 11:20:57 -0500 Date: Tue, 21 Jan 2014 14:20:53 -0200 From: Eduardo Habkost Message-ID: <20140121162053.GF2221@otherpad.lan.raisama.net> References: <1390228618-21663-1-git-send-email-ehabkost@redhat.com> <52DD9F77.4040904@suse.de> <52DE45E3.5010208@redhat.com> <52DE978E.3020309@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <52DE978E.3020309@suse.de> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] target-i386: enable x2apic by default on more recent CPU models List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?iso-8859-1?Q?F=E4rber?= Cc: "Michael S. Tsirkin" , qemu-devel@nongnu.org, Bandan Das , Anthony Liguori , Igor Mammedov , Paolo Bonzini On Tue, Jan 21, 2014 at 04:51:42PM +0100, Andreas F=E4rber wrote: > Am 21.01.2014 11:03, schrieb Paolo Bonzini: > > Il 20/01/2014 23:13, Andreas F=E4rber ha scritto: > >> I don't like the argument that we can put arbitrary stuff in our mod= el > >> definitions and rely on TCG not having implemented it to make it > >> correct. Is x2apic something that TCG can never implement for some > >> reason? Then that needs a better explanation. Otherwise, is there no > >> criteria we can add this flag for when kvm_enabled()? > >=20 > > We already do that for other bits (e.g. XSAVE/OSXSAVE), >=20 > Please point me to the commit, a search for xsave did not come up with = a > commit changing such a thing - either it did not go through my queue or > it slipped me through: Bugs are no excuse to produce more bugs. >=20 > > and in fact it > > is the same that we do for KVM: the KVM_GET_SUPPORTED_CPUID result is > > used to trim the generic feature bits. >=20 > Our model definitions are the place to put stuff that real CPUs have. > Either the CPU has it or it doesn't. If it does, then this patch is > fully correct and it's TCG's job to mask things out. If we're adding > artificial flags to the generic model definitions just to make KVM > faster, then it is wrong - we have a choice of post_initialize and > realize hooks for that. I see this as a trade-off between 3 things: 1) Having the behavior of CPU models simple (having the predictable results not depending on things like kvm_enabled()); 2) Having reasonable defaults out of the box; 3) Having the CPU models match real CPUs as closely as possible. We can't have the three at the same time. Which item are we going to let go? Your suggestion seems to kill item 1 (and I thought we didn't want to). To me 1 and 2 are more important: 1 is important to help us solve the serious issues we have in the libvirt/QEMU interaction; 2 is important because (I assume) we want to have good performance out of the box. I see 3 as just a theoretical exercise that doesn't give us any benefit. --=20 Eduardo