Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933842AbdCUSr1 (ORCPT ); Tue, 21 Mar 2017 14:47:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36874 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933305AbdCUSpu (ORCPT ); Tue, 21 Mar 2017 14:45:50 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 52E6581233 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=mst@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 52E6581233 Date: Tue, 21 Mar 2017 20:45:46 +0200 From: "Michael S. Tsirkin" To: Joerg Roedel Cc: linux-kernel@vger.kernel.org, "Gabriel L. Somlo" , Paolo Bonzini , Radim =?utf-8?B?S3LEjW3DocWZ?= , Jonathan Corbet , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, kvm@vger.kernel.org, linux-doc@vger.kernel.org Subject: Re: [PATCH v5 untested] kvm: better MWAIT emulation for guests Message-ID: <20170321204143-mutt-send-email-mst@kernel.org> References: <1489612895-12799-1-git-send-email-mst@redhat.com> <20170321161632.GF29659@8bytes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170321161632.GF29659@8bytes.org> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 21 Mar 2017 18:45:50 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 968 Lines: 29 On Tue, Mar 21, 2017 at 05:16:32PM +0100, Joerg Roedel wrote: > On Wed, Mar 15, 2017 at 11:22:18PM +0200, Michael S. Tsirkin wrote: > > diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c > > index d1efe2c..18e53bc 100644 > > --- a/arch/x86/kvm/svm.c > > +++ b/arch/x86/kvm/svm.c > > @@ -1198,8 +1198,6 @@ static void init_vmcb(struct vcpu_svm *svm) > > set_intercept(svm, INTERCEPT_CLGI); > > set_intercept(svm, INTERCEPT_SKINIT); > > set_intercept(svm, INTERCEPT_WBINVD); > > - set_intercept(svm, INTERCEPT_MONITOR); > > - set_intercept(svm, INTERCEPT_MWAIT); > > Why do you remove the intercepts for AMD? The new kvm_mwait_in_guest() > function will always return false on AMD anyway, I think that's a bug and I should fix it to return true there. > and on Intel you re-add > the intercepts for !kvm_mwait_in_guest(). > > > Joerg Does AMD need some work-around similar to CPUID5_ECX_INTERRUPT_BREAK? That's why we have kvm_mwait_in_guest ... -- MST