From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755075AbdBGRWB (ORCPT ); Tue, 7 Feb 2017 12:22:01 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:36846 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752577AbdBGRV7 (ORCPT ); Tue, 7 Feb 2017 12:21:59 -0500 Subject: Re: [PATCH] kvm: vmx: Use the hardware provided GPA instead of page walk To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Xiao Guangrong , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= References: <1485542088-18610-1-git-send-email-pbonzini@redhat.com> From: Paolo Bonzini Message-ID: Date: Tue, 7 Feb 2017 18:21:56 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <1485542088-18610-1-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 27/01/2017 19:34, Paolo Bonzini wrote: > As in the SVM patch, the guest physical address is passed by > VMX to x86_emulate_instruction already, so mark the GPA as available > in vcpu->arch. > > Signed-off-by: Paolo Bonzini > --- > arch/x86/kvm/vmx.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c > index 7c3e42623090..0828b02b5af2 100644 > --- a/arch/x86/kvm/vmx.c > +++ b/arch/x86/kvm/vmx.c > @@ -6382,6 +6382,7 @@ static int handle_ept_violation(struct kvm_vcpu *vcpu) > EPT_VIOLATION_EXECUTABLE)) > ? PFERR_PRESENT_MASK : 0; > > + vcpu->arch.gpa_available = true; > vcpu->arch.exit_qualification = exit_qualification; > > return kvm_mmu_page_fault(vcpu, gpa, error_code, NULL, 0); > @@ -6399,6 +6400,7 @@ static int handle_ept_misconfig(struct kvm_vcpu *vcpu) > } > > ret = handle_mmio_page_fault(vcpu, gpa, true); > + vcpu->arch.gpa_available = true; > if (likely(ret == RET_MMIO_PF_EMULATE)) > return x86_emulate_instruction(vcpu, gpa, 0, NULL, 0) == > EMULATE_DONE; > @@ -8517,6 +8519,7 @@ static int vmx_handle_exit(struct kvm_vcpu *vcpu) > u32 vectoring_info = vmx->idt_vectoring_info; > > trace_kvm_exit(exit_reason, vcpu, KVM_ISA_VMX); > + vcpu->arch.gpa_available = false; > > /* > * Flush logged GPAs PML buffer, this will make dirty_bitmap more > Ping? Paolo