Re: [RFC v2 PATCH 09/13] KVM: Introduce kvm_memfd_invalidate_range

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux