From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 4/5] kvm/svm: implement enhanced INVLPG intercept Date: Tue, 07 Dec 2010 15:27:28 +0200 Message-ID: <4CFE3640.4070009@redhat.com> References: <1291719586-22533-1-git-send-email-andre.przywara@amd.com> <1291719586-22533-5-git-send-email-andre.przywara@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, mtosatti@redhat.com To: Andre Przywara Return-path: Received: from mx1.redhat.com ([209.132.183.28]:48996 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753416Ab0LGN1d (ORCPT ); Tue, 7 Dec 2010 08:27:33 -0500 In-Reply-To: <1291719586-22533-5-git-send-email-andre.przywara@amd.com> Sender: kvm-owner@vger.kernel.org List-ID: On 12/07/2010 12:59 PM, Andre Przywara wrote: > When the DecodeAssist feature is available, the linear address > is provided in the VMCB on INVLPG intercepts. Use it directly to > avoid any decoding and emulation. > This is only useful for shadow paging, though. > > Signed-off-by: Andre Przywara > --- > arch/x86/kvm/svm.c | 7 ++++++- > 1 files changed, 6 insertions(+), 1 deletions(-) > > diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c > index 369bd85..3cf2cef 100644 > --- a/arch/x86/kvm/svm.c > +++ b/arch/x86/kvm/svm.c > @@ -2586,7 +2586,12 @@ static int iret_interception(struct vcpu_svm *svm) > > static int invlpg_interception(struct vcpu_svm *svm) > { > - return emulate_instruction(&svm->vcpu, 0, 0, 0) == EMULATE_DONE; > + if (!boot_cpu_has(SVM_FEATURE_DECODE_ASSIST)) > + return emulate_instruction(&svm->vcpu, 0, 0, 0) == EMULATE_DONE; static_cpu_has() > + > + kvm_mmu_invlpg(&svm->vcpu, svm->vmcb->control.exit_info_1); > + skip_emulated_instruction(&svm->vcpu); > + return 1; > } > > static int emulate_on_interception(struct vcpu_svm *svm) -- error compiling committee.c: too many arguments to function