From: Eduardo Habkost Subject: Re: [RFC 0/2] GET_EMULATED_CPUID support with "allow-emulation" option Date: Thu, 5 Jun 2014 16:12:08 -0300 Message-ID: <20140605191208.GG15000@otherpad.lan.raisama.net> References: <53909A41.1060800@redhat.com> <53909D79.1070609@suse.de> <53909E53.9050300@redhat.com> <53909E9C.6080009@suse.de> <5390A06A.9070200@redhat.com> <5390A0B6.8050000@suse.de> <5390A195.4000003@redhat.com> <20140605171908.GO17594@otherpad.lan.raisama.net> <5390AB5E.5070702@redhat.com> <20140605180253.GS17594@otherpad.lan.raisama.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Michael Mueller , kvm@vger.kernel.org, "Michael S. Tsirkin" , qemu-devel@nongnu.org, Alexander Graf , Christian Borntraeger , "Gabriel L. Somlo" , Borislav Petkov , "Jason J. Herne" , Igor Mammedov , Andreas =?iso-8859-1?Q?F=E4rber?= To: Paolo Bonzini Return-path: Content-Disposition: inline In-Reply-To: <20140605180253.GS17594@otherpad.lan.raisama.net> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org Sender: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org List-Id: kvm.vger.kernel.org Sorry for replying to my own message, but I believe we can now summarize a possible solution that makes everybody happy, and the plans for it: On Thu, Jun 05, 2014 at 03:02:53PM -0300, Eduardo Habkost wrote: > On Thu, Jun 05, 2014 at 07:39:42PM +0200, Paolo Bonzini wrote: > > Il 05/06/2014 19:19, Eduardo Habkost ha scritto: > > >On Thu, Jun 05, 2014 at 06:57:57PM +0200, Paolo Bonzini wrote: > > >>Il 05/06/2014 18:54, Alexander Graf ha scritto: > > >>>> > > >>>>What about: > > >>>> > > >>>>- letting "-cpu foo,+emulatedfeature" just work > > >>>> > > >>>>- adding emulated=yes that blindly enables all emulated features > > >>>> > > >>>>- making "-cpu ...,check" prints a warning for emulated features > > >>>>unless emulated=yes > > >>> > > >>>How about we remove the emulated=yes from this list? Then I'm happy :). > > >> > > >>So: > > >> > > >>- "-cpu foo" doesn't enable any emulated feature > > > > > >What if "foo" already has movbe in the CPU model definition? > > > > It will be disabled. > > I don't disagree with that. But not that if it will be disabled, that > means "-cpu foo,enforce" will abort. Typo. I meant "note that". > > But note that if you use "-cpu foo" without enforce, that means you can > suddenly get movbe enabled once it gets included on GET_SUPPORTED_CPUID. > > So, if you care about predictable CPUID results and you want to enable > an emulated/experimental feature, you have to do two things: > > 1) Make sure your setup works with "enforce", so you know you will > never get any feature suddenly and silently enabled. > 2) Add "+feature,allow-emulation=yes" to the command-line, keep > "enforce" and you will _not_ get any other experimental feature > suddenly enabled (because now you are using "enforce"). So, the above would cover the use cases I was thinking about. But I understand you have a different use case and you want to avoid GET_EMULATED_CPUID-related surprises even if not using "enforce". For that, you need a more fine-tuned solution using "*feature" or "feature=force". (Personally, I prefer "feature=force" instead of "*feature"). Implementing "feature=force" would be more cleanly implemented after we introduce the CPU feature properties, which we have been trying to include for 4 or 5 QEMU releases, and it was never merged. In the meantime, we could: * Include the less fine-tuned "allow-emulation" (or "allow-experimental-features") option, which is implemented by this series, for people who use "enforce" and/or don't care too much about getting other experimental features enabled. * Wait until somebody implements "feature=force". Personally, I don't care which plan we follow, as I am not an user of GET_EMULATED_CPUID. I will leave that decision for the QEMU maintainers and other developers. -- Eduardo