@@ -369,6 +369,14 @@ static int kvm_mmu_notifier_invalidate_range_start(struct mmu_notifier *mn,
int need_tlb_flush = 0, idx;
int ret;
+ /*
+ * Nothing to do when MMU_NOTIFIER_USE_CHANGE_PTE is set as it means
+ * that change_pte() will be call and it is a situation in which we
+ * allow to only rely on change_pte().
+ */
+ if (range->event & MMU_NOTIFIER_USE_CHANGE_PTE)
+ return 0;
+
idx = srcu_read_lock(&kvm->srcu);
spin_lock(&kvm->mmu_lock);
/*
@@ -398,6 +406,14 @@ static void kvm_mmu_notifier_invalidate_range_end(struct mmu_notifier *mn,
{
struct kvm *kvm = mmu_notifier_to_kvm(mn);
+ /*
+ * Nothing to do when MMU_NOTIFIER_USE_CHANGE_PTE is set as it means
+ * that change_pte() will be call and it is a situation in which we
+ * allow to only rely on change_pte().
+ */
+ if (range->event & MMU_NOTIFIER_USE_CHANGE_PTE)
+ return;
+
spin_lock(&kvm->mmu_lock);
/*
* This sequence increase will notify the kvm page fault that