[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC v2 PATCH 09/13] KVM: Introduce kvm_memfd_invalidate_range
From: |
Chao Peng |
Subject: |
Re: [RFC v2 PATCH 09/13] KVM: Introduce kvm_memfd_invalidate_range |
Date: |
Tue, 23 Nov 2021 22:24:20 +0800 |
User-agent: |
Mutt/1.9.4 (2018-02-28) |
On Tue, Nov 23, 2021 at 09:46:34AM +0100, Paolo Bonzini wrote:
> On 11/19/21 14:47, Chao Peng wrote:
> > +
> > + /* Prevent memslot modification */
> > + spin_lock(&kvm->mn_invalidate_lock);
> > + kvm->mn_active_invalidate_count++;
> > + spin_unlock(&kvm->mn_invalidate_lock);
> > +
> > + ret = __kvm_handle_useraddr_range(kvm, &useraddr_range);
> > +
> > + spin_lock(&kvm->mn_invalidate_lock);
> > + kvm->mn_active_invalidate_count--;
> > + spin_unlock(&kvm->mn_invalidate_lock);
> > +
>
>
> You need to follow this with a rcuwait_wake_up as in
> kvm_mmu_notifier_invalidate_range_end.
Oh right.
>
> It's probably best if you move the manipulations of
> mn_active_invalidate_count from kvm_mmu_notifier_invalidate_range_* to two
> separate functions.
Will do.
>
> Paolo
- Re: [RFC v2 PATCH 04/13] KVM: Add fd-based memslot data structure and utils, (continued)
- [RFC v2 PATCH 05/13] KVM: Implement fd-based memory using new memfd interfaces, Chao Peng, 2021/11/19
- [RFC v2 PATCH 06/13] KVM: Register/unregister memfd backed memslot, Chao Peng, 2021/11/19
- [RFC v2 PATCH 07/13] KVM: Handle page fault for fd based memslot, Chao Peng, 2021/11/19
- [RFC v2 PATCH 08/13] KVM: Rename hva memory invalidation code to cover fd-based offset, Chao Peng, 2021/11/19
- [RFC v2 PATCH 09/13] KVM: Introduce kvm_memfd_invalidate_range, Chao Peng, 2021/11/19
- [RFC v2 PATCH 10/13] KVM: Match inode for invalidation of fd-based slot, Chao Peng, 2021/11/19
- [RFC v2 PATCH 11/13] KVM: Add kvm_map_gfn_range, Chao Peng, 2021/11/19
- [RFC v2 PATCH 12/13] KVM: Introduce kvm_memfd_fallocate_range, Chao Peng, 2021/11/19
- [RFC v2 PATCH 13/13] KVM: Enable memfd based page invalidation/fallocate, Chao Peng, 2021/11/19
- Re: [RFC v2 PATCH 13/13] KVM: Enable memfd based page invalidation/fallocate, Paolo Bonzini, 2021/11/23