Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 190075
b: refs/heads/master
c: 77662e0
h: refs/heads/master
i:
  190073: c952392
  190071: d0bfe15
v: v3
  • Loading branch information
Xiao Guangrong authored and Avi Kivity committed Apr 20, 2010
1 parent b0eee75 commit 4b528df
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 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: 78ac8b47c566dd6177a3b9b291b756ccb70670b7
refs/heads/master: 77662e0028c7c63e34257fda03ff9625c59d939d
11 changes: 7 additions & 4 deletions trunk/arch/x86/kvm/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1490,8 +1490,8 @@ static int mmu_zap_unsync_children(struct kvm *kvm,
for_each_sp(pages, sp, parents, i) {
kvm_mmu_zap_page(kvm, sp);
mmu_pages_clear_parents(&parents);
zapped++;
}
zapped += pages.nr;
kvm_mmu_pages_init(parent, &parents, &pages);
}

Expand Down Expand Up @@ -1542,14 +1542,16 @@ void kvm_mmu_change_mmu_pages(struct kvm *kvm, unsigned int kvm_nr_mmu_pages)
*/

if (used_pages > kvm_nr_mmu_pages) {
while (used_pages > kvm_nr_mmu_pages) {
while (used_pages > kvm_nr_mmu_pages &&
!list_empty(&kvm->arch.active_mmu_pages)) {
struct kvm_mmu_page *page;

page = container_of(kvm->arch.active_mmu_pages.prev,
struct kvm_mmu_page, link);
kvm_mmu_zap_page(kvm, page);
used_pages -= kvm_mmu_zap_page(kvm, page);
used_pages--;
}
kvm_nr_mmu_pages = used_pages;
kvm->arch.n_free_mmu_pages = 0;
}
else
Expand Down Expand Up @@ -1596,7 +1598,8 @@ static void mmu_unshadow(struct kvm *kvm, gfn_t gfn)
&& !sp->role.invalid) {
pgprintk("%s: zap %lx %x\n",
__func__, gfn, sp->role.word);
kvm_mmu_zap_page(kvm, sp);
if (kvm_mmu_zap_page(kvm, sp))
nn = bucket->first;
}
}
}
Expand Down

0 comments on commit 4b528df

Please sign in to comment.