Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 202344
b: refs/heads/master
c: 7a8f1a7
h: refs/heads/master
v: v3
  • Loading branch information
Xiao Guangrong authored and Avi Kivity committed Aug 1, 2010
1 parent a00dda6 commit 372e19f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 25 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ebdea638df04ae6293a9a5414d98ad843c69e82f
refs/heads/master: 7a8f1a74e4193d21e55b35928197486f2c047efb
53 changes: 29 additions & 24 deletions trunk/arch/x86/kvm/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1149,33 +1149,38 @@ static int __mmu_unsync_walk(struct kvm_mmu_page *sp,
int i, ret, nr_unsync_leaf = 0;

for_each_unsync_children(sp->unsync_child_bitmap, i) {
struct kvm_mmu_page *child;
u64 ent = sp->spt[i];

if (is_shadow_present_pte(ent) && !is_large_pte(ent)) {
struct kvm_mmu_page *child;
child = page_header(ent & PT64_BASE_ADDR_MASK);

if (child->unsync_children) {
if (mmu_pages_add(pvec, child, i))
return -ENOSPC;

ret = __mmu_unsync_walk(child, pvec);
if (!ret) {
__clear_bit(i, sp->unsync_child_bitmap);
sp->unsync_children--;
WARN_ON((int)sp->unsync_children < 0);
} else if (ret > 0)
nr_unsync_leaf += ret;
else
return ret;
}
if (!is_shadow_present_pte(ent) || is_large_pte(ent))
goto clear_child_bitmap;

child = page_header(ent & PT64_BASE_ADDR_MASK);

if (child->unsync_children) {
if (mmu_pages_add(pvec, child, i))
return -ENOSPC;

ret = __mmu_unsync_walk(child, pvec);
if (!ret)
goto clear_child_bitmap;
else if (ret > 0)
nr_unsync_leaf += ret;
else
return ret;
} else if (child->unsync) {
nr_unsync_leaf++;
if (mmu_pages_add(pvec, child, i))
return -ENOSPC;
} else
goto clear_child_bitmap;

if (child->unsync) {
nr_unsync_leaf++;
if (mmu_pages_add(pvec, child, i))
return -ENOSPC;
}
}
continue;

clear_child_bitmap:
__clear_bit(i, sp->unsync_child_bitmap);
sp->unsync_children--;
WARN_ON((int)sp->unsync_children < 0);
}


Expand Down

0 comments on commit 372e19f

Please sign in to comment.