diff options
author | Ingo Molnar <mingo@elte.hu> | 2007-01-05 19:36:57 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2007-01-06 02:55:28 -0500 |
commit | 7f7417d67ea6c1538469e3ea005484e807642c0a (patch) | |
tree | 5d164c2e78a31abdbfcf2757fef09075aef44e70 /drivers/kvm | |
parent | 86a2b42e81b8236d9454f5c2d7113a82ed25c735 (diff) |
[PATCH] KVM: Avoid oom on cr3 switch
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/kvm')
-rw-r--r-- | drivers/kvm/mmu.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/kvm/mmu.c b/drivers/kvm/mmu.c index 6e7381bc2218..4118e504e647 100644 --- a/drivers/kvm/mmu.c +++ b/drivers/kvm/mmu.c | |||
@@ -905,6 +905,8 @@ static void paging_new_cr3(struct kvm_vcpu *vcpu) | |||
905 | { | 905 | { |
906 | pgprintk("%s: cr3 %lx\n", __FUNCTION__, vcpu->cr3); | 906 | pgprintk("%s: cr3 %lx\n", __FUNCTION__, vcpu->cr3); |
907 | mmu_free_roots(vcpu); | 907 | mmu_free_roots(vcpu); |
908 | if (unlikely(vcpu->kvm->n_free_mmu_pages < KVM_MIN_FREE_MMU_PAGES)) | ||
909 | kvm_mmu_free_some_pages(vcpu); | ||
908 | mmu_alloc_roots(vcpu); | 910 | mmu_alloc_roots(vcpu); |
909 | kvm_mmu_flush_tlb(vcpu); | 911 | kvm_mmu_flush_tlb(vcpu); |
910 | kvm_arch_ops->set_cr3(vcpu, vcpu->mmu.root_hpa); | 912 | kvm_arch_ops->set_cr3(vcpu, vcpu->mmu.root_hpa); |