Re: [PATCH 2/8] KVM: x86: extend struct kvm_vcpu_pv_apf_data with token info

2020-05-26 Thread Vivek Goyal
On Sat, May 23, 2020 at 06:34:17PM +0200, Vitaly Kuznetsov wrote: > Vivek Goyal writes: > > > On Mon, May 11, 2020 at 06:47:46PM +0200, Vitaly Kuznetsov wrote: > >> Currently, APF mechanism relies on the #PF abuse where the token is being > >> passed through CR2. If we switch to using interrupts

Re: [PATCH 2/8] KVM: x86: extend struct kvm_vcpu_pv_apf_data with token info

2020-05-23 Thread Vitaly Kuznetsov
Vivek Goyal writes: > On Mon, May 11, 2020 at 06:47:46PM +0200, Vitaly Kuznetsov wrote: >> Currently, APF mechanism relies on the #PF abuse where the token is being >> passed through CR2. If we switch to using interrupts to deliver page-ready >> notifications we need a different way to pass the d

Re: [PATCH 2/8] KVM: x86: extend struct kvm_vcpu_pv_apf_data with token info

2020-05-22 Thread Paolo Bonzini
On 21/05/20 16:59, Vitaly Kuznetsov wrote: >> However, interrupts for 'page ready' do have a bunch of advantages (more >> control on what can be preempted by the notification, a saner check for >> new page faults which is effectively a bug fix) so it makes sense to get >> them in more quickly (prob

Re: [PATCH 2/8] KVM: x86: extend struct kvm_vcpu_pv_apf_data with token info

2020-05-21 Thread Vivek Goyal
On Mon, May 11, 2020 at 06:47:46PM +0200, Vitaly Kuznetsov wrote: > Currently, APF mechanism relies on the #PF abuse where the token is being > passed through CR2. If we switch to using interrupts to deliver page-ready > notifications we need a different way to pass the data. Extent the existing >

Re: [PATCH 2/8] KVM: x86: extend struct kvm_vcpu_pv_apf_data with token info

2020-05-21 Thread Vitaly Kuznetsov
Paolo Bonzini writes: > However, interrupts for 'page ready' do have a bunch of advantages (more > control on what can be preempted by the notification, a saner check for > new page faults which is effectively a bug fix) so it makes sense to get > them in more quickly (probably 5.9 at this point

Re: [PATCH 2/8] KVM: x86: extend struct kvm_vcpu_pv_apf_data with token info

2020-05-15 Thread Sean Christopherson
On Sat, May 16, 2020 at 12:23:31AM +0200, Paolo Bonzini wrote: > On 15/05/20 22:43, Sean Christopherson wrote: > > On Fri, May 15, 2020 at 09:18:07PM +0200, Paolo Bonzini wrote: > >> On 15/05/20 20:46, Sean Christopherson wrote: > >>> Why even bother using 'struct kvm_vcpu_pv_apf_data' for the #PF

Re: [PATCH 2/8] KVM: x86: extend struct kvm_vcpu_pv_apf_data with token info

2020-05-15 Thread Paolo Bonzini
On 15/05/20 22:43, Sean Christopherson wrote: > On Fri, May 15, 2020 at 09:18:07PM +0200, Paolo Bonzini wrote: >> On 15/05/20 20:46, Sean Christopherson wrote: >>> Why even bother using 'struct kvm_vcpu_pv_apf_data' for the #PF case? VMX >>> only requires error_code[31:16]==0 and SVM doesn't vet i

Re: [PATCH 2/8] KVM: x86: extend struct kvm_vcpu_pv_apf_data with token info

2020-05-15 Thread Sean Christopherson
On Fri, May 15, 2020 at 04:33:52PM -0400, Vivek Goyal wrote: > On Fri, May 15, 2020 at 09:18:07PM +0200, Paolo Bonzini wrote: > > On 15/05/20 20:46, Sean Christopherson wrote: > > >> The new one using #VE is not coming very soon (we need to emulate it for > > >> > >> going to keep "page not ready"

Re: [PATCH 2/8] KVM: x86: extend struct kvm_vcpu_pv_apf_data with token info

2020-05-15 Thread Sean Christopherson
On Fri, May 15, 2020 at 09:18:07PM +0200, Paolo Bonzini wrote: > On 15/05/20 20:46, Sean Christopherson wrote: > > Why even bother using 'struct kvm_vcpu_pv_apf_data' for the #PF case? VMX > > only requires error_code[31:16]==0 and SVM doesn't vet it at all, i.e. we > > can (ab)use the error code

Re: [PATCH 2/8] KVM: x86: extend struct kvm_vcpu_pv_apf_data with token info

2020-05-15 Thread Vivek Goyal
On Fri, May 15, 2020 at 09:18:07PM +0200, Paolo Bonzini wrote: > On 15/05/20 20:46, Sean Christopherson wrote: > >> The new one using #VE is not coming very soon (we need to emulate it for > >> >> going to keep "page not ready" delivery using #PF for some time or even > >> forever. However, page

Re: [PATCH 2/8] KVM: x86: extend struct kvm_vcpu_pv_apf_data with token info

2020-05-15 Thread Paolo Bonzini
On 15/05/20 20:46, Sean Christopherson wrote: >> The new one using #VE is not coming very soon (we need to emulate it for >> > going to keep "page not ready" delivery using #PF for some time or even >> forever. However, page ready notification as #PF is going away for good. > > And isn't hardware

Re: [PATCH 2/8] KVM: x86: extend struct kvm_vcpu_pv_apf_data with token info

2020-05-15 Thread Sean Christopherson
On Fri, May 15, 2020 at 05:59:43PM +0200, Paolo Bonzini wrote: > On 13/05/20 14:52, Vivek Goyal wrote: > >>> Also, type of event should not necessarily be tied to delivery method. > >>> For example if we end up introducing say, "KVM_PV_REASON_PAGE_ERROR", then > >>> I would think that event can be

Re: [PATCH 2/8] KVM: x86: extend struct kvm_vcpu_pv_apf_data with token info

2020-05-15 Thread Paolo Bonzini
On 13/05/20 14:52, Vivek Goyal wrote: >>> Also, type of event should not necessarily be tied to delivery method. >>> For example if we end up introducing say, "KVM_PV_REASON_PAGE_ERROR", then >>> I would think that event can be injected both using exception (#PF or #VE) >>> as well as interrupt (de

Re: [PATCH 2/8] KVM: x86: extend struct kvm_vcpu_pv_apf_data with token info

2020-05-13 Thread Vivek Goyal
On Tue, May 12, 2020 at 10:50:17AM -0700, Sean Christopherson wrote: > On Tue, May 12, 2020 at 11:53:39AM -0400, Vivek Goyal wrote: > > On Tue, May 12, 2020 at 05:40:10PM +0200, Vitaly Kuznetsov wrote: > > > Vivek Goyal writes: > > > > > > > On Mon, May 11, 2020 at 06:47:46PM +0200, Vitaly Kuznet

Re: [PATCH 2/8] KVM: x86: extend struct kvm_vcpu_pv_apf_data with token info

2020-05-13 Thread Vitaly Kuznetsov
Sean Christopherson writes: > > Why bother preserving backwards compatibility? AIUI, both KVM and guest > will support async #PF iff interrupt delivery is enabled. Why not make > the interrupt delivery approach KVM_ASYNC_PF_V2 and completely redefine the > ABI? E.g. to make it compatible with

Re: [PATCH 2/8] KVM: x86: extend struct kvm_vcpu_pv_apf_data with token info

2020-05-12 Thread Vivek Goyal
On Tue, May 12, 2020 at 05:40:10PM +0200, Vitaly Kuznetsov wrote: > Vivek Goyal writes: > > > On Mon, May 11, 2020 at 06:47:46PM +0200, Vitaly Kuznetsov wrote: > >> Currently, APF mechanism relies on the #PF abuse where the token is being > >> passed through CR2. If we switch to using interrupts

Re: [PATCH 2/8] KVM: x86: extend struct kvm_vcpu_pv_apf_data with token info

2020-05-12 Thread Sean Christopherson
On Tue, May 12, 2020 at 11:53:39AM -0400, Vivek Goyal wrote: > On Tue, May 12, 2020 at 05:40:10PM +0200, Vitaly Kuznetsov wrote: > > Vivek Goyal writes: > > > > > On Mon, May 11, 2020 at 06:47:46PM +0200, Vitaly Kuznetsov wrote: > > >> Currently, APF mechanism relies on the #PF abuse where the to

Re: [PATCH 2/8] KVM: x86: extend struct kvm_vcpu_pv_apf_data with token info

2020-05-12 Thread Vivek Goyal
On Tue, May 12, 2020 at 05:40:10PM +0200, Vitaly Kuznetsov wrote: > Vivek Goyal writes: > > > On Mon, May 11, 2020 at 06:47:46PM +0200, Vitaly Kuznetsov wrote: > >> Currently, APF mechanism relies on the #PF abuse where the token is being > >> passed through CR2. If we switch to using interrupts

Re: [PATCH 2/8] KVM: x86: extend struct kvm_vcpu_pv_apf_data with token info

2020-05-12 Thread Vitaly Kuznetsov
Vivek Goyal writes: > On Mon, May 11, 2020 at 06:47:46PM +0200, Vitaly Kuznetsov wrote: >> Currently, APF mechanism relies on the #PF abuse where the token is being >> passed through CR2. If we switch to using interrupts to deliver page-ready >> notifications we need a different way to pass the d

Re: [PATCH 2/8] KVM: x86: extend struct kvm_vcpu_pv_apf_data with token info

2020-05-12 Thread Vivek Goyal
On Mon, May 11, 2020 at 06:47:46PM +0200, Vitaly Kuznetsov wrote: > Currently, APF mechanism relies on the #PF abuse where the token is being > passed through CR2. If we switch to using interrupts to deliver page-ready > notifications we need a different way to pass the data. Extent the existing >

[PATCH 2/8] KVM: x86: extend struct kvm_vcpu_pv_apf_data with token info

2020-05-11 Thread Vitaly Kuznetsov
Currently, APF mechanism relies on the #PF abuse where the token is being passed through CR2. If we switch to using interrupts to deliver page-ready notifications we need a different way to pass the data. Extent the existing 'struct kvm_vcpu_pv_apf_data' with token information for page-ready notifi