Revert "KVM: Eliminate extra function calls in kvm_get_dirty_log_protect()"
authorLan Tianyu <Tianyu.Lan@microsoft.com>
Sat, 2 Feb 2019 09:20:27 +0000 (17:20 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 20 Feb 2019 21:48:52 +0000 (22:48 +0100)
The value of "dirty_bitmap[i]" is already check before setting its value
to mask. The following check of "mask" is redundant. The check of "mask" was
introduced by commit 58d2930f4ee3 ("KVM: Eliminate extra function calls in
kvm_get_dirty_log_protect()"), revert it.

Signed-off-by: Lan Tianyu <Tianyu.Lan@microsoft.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
virt/kvm/kvm_main.c

index 5087cf703ed17767f8aa31130c231367364480e9..276af92ace6c33925dba752c8d0d3acce70d3370 100644 (file)
@@ -1205,11 +1205,9 @@ int kvm_get_dirty_log_protect(struct kvm *kvm,
                        mask = xchg(&dirty_bitmap[i], 0);
                        dirty_bitmap_buffer[i] = mask;
 
-                       if (mask) {
-                               offset = i * BITS_PER_LONG;
-                               kvm_arch_mmu_enable_log_dirty_pt_masked(kvm, memslot,
-                                                                       offset, mask);
-                       }
+                       offset = i * BITS_PER_LONG;
+                       kvm_arch_mmu_enable_log_dirty_pt_masked(kvm, memslot,
+                                                               offset, mask);
                }
                spin_unlock(&kvm->mmu_lock);
        }