[Top][All Lists]

[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: Paolo Bonzini
Subject: Re: [RFC v2 PATCH 09/13] KVM: Introduce kvm_memfd_invalidate_range
Date: Tue, 23 Nov 2021 09:46:34 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0

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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]