Commit ebdea638 authored by Xiao Guangrong's avatar Xiao Guangrong Committed by Avi Kivity

KVM: MMU: cleanup for __mmu_unsync_walk()

Decrease sp->unsync_children after clear unsync_child_bitmap bit
Signed-off-by: default avatarXiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Signed-off-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
parent be71e061
...@@ -1160,9 +1160,11 @@ static int __mmu_unsync_walk(struct kvm_mmu_page *sp, ...@@ -1160,9 +1160,11 @@ static int __mmu_unsync_walk(struct kvm_mmu_page *sp,
return -ENOSPC; return -ENOSPC;
ret = __mmu_unsync_walk(child, pvec); ret = __mmu_unsync_walk(child, pvec);
if (!ret) if (!ret) {
__clear_bit(i, sp->unsync_child_bitmap); __clear_bit(i, sp->unsync_child_bitmap);
else if (ret > 0) sp->unsync_children--;
WARN_ON((int)sp->unsync_children < 0);
} else if (ret > 0)
nr_unsync_leaf += ret; nr_unsync_leaf += ret;
else else
return ret; return ret;
...@@ -1176,8 +1178,6 @@ static int __mmu_unsync_walk(struct kvm_mmu_page *sp, ...@@ -1176,8 +1178,6 @@ static int __mmu_unsync_walk(struct kvm_mmu_page *sp,
} }
} }
if (find_first_bit(sp->unsync_child_bitmap, 512) == 512)
sp->unsync_children = 0;
return nr_unsync_leaf; return nr_unsync_leaf;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment