lkml.org 
[lkml]   [2021]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    SubjectRe: [RFC v2 PATCH 09/13] KVM: Introduce kvm_memfd_invalidate_range
    From
    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.

    It's probably best if you move the manipulations of
    mn_active_invalidate_count from kvm_mmu_notifier_invalidate_range_* to
    two separate functions.

    Paolo

    \
     
     \ /
      Last update: 2021-11-23 09:47    [W:4.280 / U:0.076 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site