From mboxrd@z Thu Jan 1 00:00:00 1970 From: "H. Peter Anvin" Subject: Re: [PATCH -v2] kvm: Emulate MOVBE Date: Sun, 14 Apr 2013 11:36:29 -0700 Message-ID: <4bbedfc0-67cb-48de-bfb5-2e0b0c42a9f6@email.android.com> References: <20130409234602.GI5077@pd.tnic> <20130410112942.07dfc167@slackpad> <20130410100845.GB17919@redhat.com> <20130410123901.46b65169@slackpad> <20130410121639.GE17919@redhat.com> <20130411001815.GA17544@pd.tnic> <20130411142818.GA17919@redhat.com> <20130411153733.GE27062@pd.tnic> <20130414074107.GD17919@redhat.com> <20130414173215.GD20547@pd.tnic> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Andre Przywara , kvm@vger.kernel.org, =?ISO-8859-1?Q?J=F6rg_R=F6del?= , x86-ml To: Borislav Petkov , Gleb Natapov Return-path: Received: from terminus.zytor.com ([198.137.202.10]:49325 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753121Ab3DNSgz (ORCPT ); Sun, 14 Apr 2013 14:36:55 -0400 In-Reply-To: <20130414173215.GD20547@pd.tnic> Sender: kvm-owner@vger.kernel.org List-ID: Just to interject here... all this is about host kernel vs userspace, correct? I.e. nothing that affects the guest. I assume that the guest sees CPUID and that is what is supported. Borislav Petkov wrote: >On Sun, Apr 14, 2013 at 10:41:07AM +0300, Gleb Natapov wrote: >> Currently userspace assumes that that cpuid configuration returned by >> KVM_GET_SUPPORTED_CPUID is the optimal one. What we want here is a >way >> for KVM to tell userspace that it can emulate movbe though it is not >> optimal. > >Ok, I don't understand. > >You want to tell userspace: "yes, we do support a hw feature but we >emulate it."? > >> Userspace alone cannot figure it out. It can check host's cpuid >> directly and assume that if cpuid bit is not present on the host cpu, >> but reported as supported by KVM then it is emulated by KVM and this >is >> not optimal, but sometimes emulation is actually desirable (x2apic), >so >> such assumption is not always correct. > >Right, and this is what we have, AFAICT. And if userspace does that >what >you exemplify above, you get exactly that - a feature bit not set in >CPUID but KVM reporting it set means, it is emulated. There's no room >for other interpretations here. Which probably means also not optimal >because it is not done in hw. > >Or, do you want to have a way to say with KVM_GET_SUPPORTED_CPUID that >"the features I'm reporting to you are those - a subset of them are not >optimally supported because I'm emulating them." > >Am I close? > >Thanks. -- Sent from my mobile phone. Please excuse brevity and lack of formatting.