Skip to content

Commit

Permalink
KVM: MMU: Topup the mmu memory preallocation caches before emulating …
Browse files Browse the repository at this point in the history
…an insn

Emulation may cause a shadow pte to be instantiated, which requires
memory resources.  Make sure the caches are filled to avoid an oops.

Signed-off-by: Avi Kivity <avi@qumranet.com>
  • Loading branch information
Avi Kivity committed Jan 30, 2008
1 parent 3067714 commit b733bfb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/kvm/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1362,6 +1362,10 @@ int kvm_mmu_page_fault(struct kvm_vcpu *vcpu, gva_t cr2, u32 error_code)
goto out;
}

r = mmu_topup_memory_caches(vcpu);
if (r)
goto out;

er = emulate_instruction(vcpu, vcpu->run, cr2, error_code, 0);
mutex_unlock(&vcpu->kvm->lock);

Expand Down

0 comments on commit b733bfb

Please sign in to comment.