From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [RFC PATCH] Emulate MOVBE Date: Wed, 10 Apr 2013 15:16:39 +0300 Message-ID: <20130410121639.GE17919@redhat.com> References: <20130409234602.GI5077@pd.tnic> <20130410112942.07dfc167@slackpad> <20130410100845.GB17919@redhat.com> <20130410123901.46b65169@slackpad> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Borislav Petkov , kvm@vger.kernel.org, =?utf-8?B?SsO2cmcgUsO2ZGVs?= , "H. Peter Anvin" , x86-ml To: Andre Przywara Return-path: Received: from mx1.redhat.com ([209.132.183.28]:8829 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936315Ab3DJMQz (ORCPT ); Wed, 10 Apr 2013 08:16:55 -0400 Content-Disposition: inline In-Reply-To: <20130410123901.46b65169@slackpad> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Apr 10, 2013 at 12:39:01PM +0200, Andre Przywara wrote: > On Wed, 10 Apr 2013 13:08:46 +0300 > Gleb Natapov wrote: > > > On Wed, Apr 10, 2013 at 11:29:42AM +0200, Andre Przywara wrote: > > > In a real world VendorSpecific should be replaced with something > > > more meaningful. Depends on KVMs intention to emulate instructions, > > > actually out of scope for a pure virtualizer. > > > > > Something like EmulateOnUD. > > Right. > > > > What is the opinion from the KVM folks on this? Shall we start to > > > emulate instructions the host does not provide? In this particular > > > case a relatively simple patch fixes a problem (starting Atom > > > optimized kernels on non-Atom machines). > > We can add the emulation, but we should not start announcing the > > instruction availability to a guest if host cpu does not have it by > > default. This may trick a guest into thinking that movbe is the > > fastest way to do something when it is not. > > Good point. I'd also like to have a switch which enables this kind of > "non-standard" behavior. Actually this should be requested by QEMU, > right? So that a single guest can override the CPUID masking done by > the kernel if it really really wants to. > Right, the question is how kernel can tell QEMU that the cpuid bit is supported but should not be set unless explicitly asked by an user. > > > > > > (And if one can believe the AMD Fam16h SWOG [1], PS4^Wfuture AMD > > > processors have MOVBE, so it's not even actually one CPU anymore). > > If a host CPU has the instruction emulation is not needed unless the > > instruction is used for MMIO access. > > I meant to "emulate" such a CPU. -cpu ps4 ;-) > Ah, OK. -- Gleb.