Skip to contentSkip to conversation

Revert "KVM: Eliminate extra function calls in kvm_get_dirty_log_protect()"

PATCH Applied [email protected] 2 participants 2 messages Feb 2, 2019 – Feb 14, 2019 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Revert "KVM: Eliminate extra function calls in kvm_get_dirty_log_protect()"

From: Lan Tianyu <[email protected]>

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()"). This patch is to revert the patch.

---
 virt/kvm/kvm_main.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
virt/kvm/kvm_main.c +3 -5
index 2bdc827b9ee9..ef06cfb9b52b 100644
@@ -1200,11 +1200,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);
 	}
Signature · 1 line
2.14.4
maintainer Applied
#1 lore raw
Quoted 22 lines · On 02/02/19 10:20, [email protected] wrote:

From: Lan Tianyu <[email protected]>

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()"). This patch is to revert the patch.

---
 virt/kvm/kvm_main.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
virt/kvm/kvm_main.c +0 -1
index 2bdc827b9ee9..ef06cfb9b52b 100644
@@ -1200,11 +1200,9 @@ int kvm_get_dirty_log_protect(struct kvm *kvm,
 			mask = xchg(&dirty_bitmap[i], 0);
 			dirty_bitmap_buffer[i] = mask;
 
-			if (mask) {

virt/kvm/kvm_main.c int kvm_get_dirty_log_protect(struct kvm *kvm, · line 1208

Quoted 10 lines
virt/kvm/kvm_main.c +3 -4
-				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);
 	}

Queued, thanks.

Paolo