From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752342AbbCIX3d (ORCPT ); Mon, 9 Mar 2015 19:29:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42418 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751016AbbCIX3a (ORCPT ); Mon, 9 Mar 2015 19:29:30 -0400 Date: Mon, 9 Mar 2015 20:28:46 -0300 From: Marcelo Tosatti To: Joel Schopp Cc: Gleb Natapov , Paolo Bonzini , kvm@vger.kernel.org, David Kaplan , rkrcmar@redhat.com, Joerg Roedel , linux-kernel@vger.kernel.org, Borislav Petkov Subject: Re: [PATCH] x86: svm: make wbinvd faster Message-ID: <20150309232846.GB12125@amt.cnet> References: <20150228001917.15247.41063.stgit@joelvmguard2.amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150228001917.15247.41063.stgit@joelvmguard2.amd.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 27, 2015 at 06:19:18PM -0600, Joel Schopp wrote: > From: David Kaplan > No need to re-decode WBINVD since we know what it is from the intercept. > > Signed-off-by: David Kaplan > [extracted from larger unlrelated patch, forward ported, tested] > Signed-off-by: Joel Schopp Can't you disable the intercept if need_emulate_wbinvd(vcpu) == false? > --- > arch/x86/kvm/svm.c | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c > index d319e0c..86ecd21 100644 > --- a/arch/x86/kvm/svm.c > +++ b/arch/x86/kvm/svm.c > @@ -2776,6 +2776,14 @@ static int skinit_interception(struct vcpu_svm *svm) > return 1; > } > > +static int wbinvd_interception(struct vcpu_svm *svm) > +{ > + kvm_emulate_wbinvd(&svm->vcpu); > + skip_emulated_instruction(&svm->vcpu); > + return 1; > +} > + > + > static int xsetbv_interception(struct vcpu_svm *svm) > { > u64 new_bv = kvm_read_edx_eax(&svm->vcpu); > @@ -3376,7 +3384,7 @@ static int (*const svm_exit_handlers[])(struct vcpu_svm *svm) = { > [SVM_EXIT_STGI] = stgi_interception, > [SVM_EXIT_CLGI] = clgi_interception, > [SVM_EXIT_SKINIT] = skinit_interception, > - [SVM_EXIT_WBINVD] = emulate_on_interception, > + [SVM_EXIT_WBINVD] = wbinvd_interception, > [SVM_EXIT_MONITOR] = monitor_interception, > [SVM_EXIT_MWAIT] = mwait_interception, > [SVM_EXIT_XSETBV] = xsetbv_interception, > > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html