* [PATCH] kvm: vmx: Use the hardware provided GPA instead of page walk
@ 2017-01-27 18:34 Paolo Bonzini
2017-02-07 17:21 ` Paolo Bonzini
2017-02-07 20:52 ` Radim Krčmář
0 siblings, 2 replies; 4+ messages in thread
From: Paolo Bonzini @ 2017-01-27 18:34 UTC (permalink / raw)
To: linux-kernel, kvm
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 <pbonzini@redhat.com>
---
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
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] kvm: vmx: Use the hardware provided GPA instead of page walk
2017-01-27 18:34 [PATCH] kvm: vmx: Use the hardware provided GPA instead of page walk Paolo Bonzini
@ 2017-02-07 17:21 ` Paolo Bonzini
2017-02-07 20:52 ` Radim Krčmář
1 sibling, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2017-02-07 17:21 UTC (permalink / raw)
To: linux-kernel, kvm, Xiao Guangrong, Radim Krčmář
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 <pbonzini@redhat.com>
> ---
> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] kvm: vmx: Use the hardware provided GPA instead of page walk
2017-01-27 18:34 [PATCH] kvm: vmx: Use the hardware provided GPA instead of page walk Paolo Bonzini
2017-02-07 17:21 ` Paolo Bonzini
@ 2017-02-07 20:52 ` Radim Krčmář
2017-02-08 8:16 ` Paolo Bonzini
1 sibling, 1 reply; 4+ messages in thread
From: Radim Krčmář @ 2017-02-07 20:52 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: linux-kernel, kvm
2017-01-27 19:34+0100, Paolo Bonzini:
> 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 <pbonzini@redhat.com>
> ---
In line with the SVM patch,
Reviewed-by: Radim Krčmář <rkrcmar@redhat.com>
Still, I don't see why we need a variable that is touched on every VM
exit. Is this a mere shortcut to propagating the gpa_available bit with
the gpa argument to kvm_mmu_page_fault() and x86_emulate_instruction()?
Thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] kvm: vmx: Use the hardware provided GPA instead of page walk
2017-02-07 20:52 ` Radim Krčmář
@ 2017-02-08 8:16 ` Paolo Bonzini
0 siblings, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2017-02-08 8:16 UTC (permalink / raw)
To: Radim Krčmář; +Cc: linux-kernel, kvm
On 07/02/2017 21:52, Radim Krčmář wrote:
> 2017-01-27 19:34+0100, Paolo Bonzini:
>> 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 <pbonzini@redhat.com>
>> ---
>
> In line with the SVM patch,
>
> Reviewed-by: Radim Krčmář <rkrcmar@redhat.com>
>
> Still, I don't see why we need a variable that is touched on every VM
> exit. Is this a mere shortcut to propagating the gpa_available bit with
> the gpa argument to kvm_mmu_page_fault() and x86_emulate_instruction()?
Yes, pretty much.
Paolo
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-02-08 8:16 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-27 18:34 [PATCH] kvm: vmx: Use the hardware provided GPA instead of page walk Paolo Bonzini
2017-02-07 17:21 ` Paolo Bonzini
2017-02-07 20:52 ` Radim Krčmář
2017-02-08 8:16 ` Paolo Bonzini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.