Revert "KVM: Eliminate extra function calls in kvm_get_dirty_log_protect()"
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
@@ -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
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.Signed-off-by Lan Tianyu <[email protected]>--- virt/kvm/kvm_main.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)virt/kvm/kvm_main.c +0
-1@@ -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