Re: [PATCH v5 15/19] KVM: Provide common implementation for generic dirty log functions

2020-02-18 Thread Sean Christopherson
On Mon, Feb 17, 2020 at 04:39:39PM +0100, Vitaly Kuznetsov wrote: > Sean Christopherson writes: > > Unless it's functionally incorrect (Vitaly?), going with option (2) and > > naming the hook kvm_arch_flush_remote_tlbs_memslot() seems like the obvious > > choice, e.g. the final cleanup gives this

Re: [PATCH v5 15/19] KVM: Provide common implementation for generic dirty log functions

2020-02-17 Thread Vitaly Kuznetsov
Sean Christopherson writes: > On Fri, Feb 07, 2020 at 07:53:34PM -0500, Peter Xu wrote: >> On Fri, Feb 07, 2020 at 04:42:33PM -0800, Sean Christopherson wrote: >> > On Fri, Feb 07, 2020 at 07:18:32PM -0500, Peter Xu wrote: >> > > On Fri, Feb 07, 2020 at 11:45:32AM -0800, Sean Christopherson wrote

Re: [PATCH v5 15/19] KVM: Provide common implementation for generic dirty log functions

2020-02-17 Thread Vitaly Kuznetsov
Sean Christopherson writes: > +Vitaly for HyperV > > On Thu, Feb 06, 2020 at 04:41:06PM -0500, Peter Xu wrote: >> On Thu, Feb 06, 2020 at 01:21:20PM -0800, Sean Christopherson wrote: >> > On Thu, Feb 06, 2020 at 03:02:00PM -0500, Peter Xu wrote: >> > > But that matters to this patch because if MI

Re: [PATCH v5 15/19] KVM: Provide common implementation for generic dirty log functions

2020-02-07 Thread Sean Christopherson
On Fri, Feb 07, 2020 at 07:53:34PM -0500, Peter Xu wrote: > On Fri, Feb 07, 2020 at 04:42:33PM -0800, Sean Christopherson wrote: > > On Fri, Feb 07, 2020 at 07:18:32PM -0500, Peter Xu wrote: > > > On Fri, Feb 07, 2020 at 11:45:32AM -0800, Sean Christopherson wrote: > > > > +Vitaly for HyperV > > >

Re: [PATCH v5 15/19] KVM: Provide common implementation for generic dirty log functions

2020-02-07 Thread Peter Xu
On Fri, Feb 07, 2020 at 04:42:33PM -0800, Sean Christopherson wrote: > On Fri, Feb 07, 2020 at 07:18:32PM -0500, Peter Xu wrote: > > On Fri, Feb 07, 2020 at 11:45:32AM -0800, Sean Christopherson wrote: > > > +Vitaly for HyperV > > > > > > On Thu, Feb 06, 2020 at 04:41:06PM -0500, Peter Xu wrote: >

Re: [PATCH v5 15/19] KVM: Provide common implementation for generic dirty log functions

2020-02-07 Thread Sean Christopherson
On Fri, Feb 07, 2020 at 07:18:32PM -0500, Peter Xu wrote: > On Fri, Feb 07, 2020 at 11:45:32AM -0800, Sean Christopherson wrote: > > +Vitaly for HyperV > > > > On Thu, Feb 06, 2020 at 04:41:06PM -0500, Peter Xu wrote: > > > On Thu, Feb 06, 2020 at 01:21:20PM -0800, Sean Christopherson wrote: > > >

Re: [PATCH v5 15/19] KVM: Provide common implementation for generic dirty log functions

2020-02-07 Thread Peter Xu
On Fri, Feb 07, 2020 at 11:45:32AM -0800, Sean Christopherson wrote: > +Vitaly for HyperV > > On Thu, Feb 06, 2020 at 04:41:06PM -0500, Peter Xu wrote: > > On Thu, Feb 06, 2020 at 01:21:20PM -0800, Sean Christopherson wrote: > > > On Thu, Feb 06, 2020 at 03:02:00PM -0500, Peter Xu wrote: > > > > B

Re: [PATCH v5 15/19] KVM: Provide common implementation for generic dirty log functions

2020-02-07 Thread Sean Christopherson
+Vitaly for HyperV On Thu, Feb 06, 2020 at 04:41:06PM -0500, Peter Xu wrote: > On Thu, Feb 06, 2020 at 01:21:20PM -0800, Sean Christopherson wrote: > > On Thu, Feb 06, 2020 at 03:02:00PM -0500, Peter Xu wrote: > > > But that matters to this patch because if MIPS can use > > > kvm_flush_remote_tlbs

Re: [PATCH v5 15/19] KVM: Provide common implementation for generic dirty log functions

2020-02-06 Thread Peter Xu
On Thu, Feb 06, 2020 at 01:21:20PM -0800, Sean Christopherson wrote: > On Thu, Feb 06, 2020 at 03:02:00PM -0500, Peter Xu wrote: > > On Tue, Jan 21, 2020 at 02:31:53PM -0800, Sean Christopherson wrote: > > > > [...] > > > > > -int kvm_vm_ioctl_clear_dirty_log(struct kvm *kvm, struct > > > kvm_cl

Re: [PATCH v5 15/19] KVM: Provide common implementation for generic dirty log functions

2020-02-06 Thread Peter Xu
On Tue, Jan 21, 2020 at 02:31:53PM -0800, Sean Christopherson wrote: [...] > @@ -1333,6 +1369,7 @@ int kvm_clear_dirty_log_protect(struct kvm *kvm, > unsigned long i, n; > unsigned long *dirty_bitmap; > unsigned long *dirty_bitmap_buffer; > + bool flush; > > as_id =

Re: [PATCH v5 15/19] KVM: Provide common implementation for generic dirty log functions

2020-02-06 Thread Sean Christopherson
On Thu, Feb 06, 2020 at 03:02:00PM -0500, Peter Xu wrote: > On Tue, Jan 21, 2020 at 02:31:53PM -0800, Sean Christopherson wrote: > > [...] > > > -int kvm_vm_ioctl_clear_dirty_log(struct kvm *kvm, struct > > kvm_clear_dirty_log *log) > > +void kvm_arch_dirty_log_tlb_flush(struct kvm *kvm, > > +

Re: [PATCH v5 15/19] KVM: Provide common implementation for generic dirty log functions

2020-02-06 Thread Peter Xu
On Tue, Jan 21, 2020 at 02:31:53PM -0800, Sean Christopherson wrote: [...] > -int kvm_vm_ioctl_clear_dirty_log(struct kvm *kvm, struct kvm_clear_dirty_log > *log) > +void kvm_arch_dirty_log_tlb_flush(struct kvm *kvm, > + struct kvm_memory_slot *memslot) If it's to

[PATCH v5 15/19] KVM: Provide common implementation for generic dirty log functions

2020-01-21 Thread Sean Christopherson
Move the implementations of KVM_GET_DIRTY_LOG and KVM_CLEAR_DIRTY_LOG for CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT into common KVM code. The arch specific implemenations are extremely similar, differing only in whether the dirty log needs to be sync'd from hardware (x86) and how the TLBs are flushe