diff options
author | Avi Kivity <avi@qumranet.com> | 2007-10-28 12:52:05 -0400 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-01-30 10:52:57 -0500 |
commit | b733bfb524af69612f85c36a511f0109c5e3fe8d (patch) | |
tree | 7d9920070b78d7d84f7def39501bb211dc8de602 | |
parent | 3067714cf59bd4a6dbf788b709485bc62c1ff845 (diff) |
KVM: MMU: Topup the mmu memory preallocation caches before emulating 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>
-rw-r--r-- | drivers/kvm/mmu.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/kvm/mmu.c b/drivers/kvm/mmu.c index ace3cb86214b..9be54a5e858e 100644 --- a/drivers/kvm/mmu.c +++ b/drivers/kvm/mmu.c | |||
@@ -1362,6 +1362,10 @@ int kvm_mmu_page_fault(struct kvm_vcpu *vcpu, gva_t cr2, u32 error_code) | |||
1362 | goto out; | 1362 | goto out; |
1363 | } | 1363 | } |
1364 | 1364 | ||
1365 | r = mmu_topup_memory_caches(vcpu); | ||
1366 | if (r) | ||
1367 | goto out; | ||
1368 | |||
1365 | er = emulate_instruction(vcpu, vcpu->run, cr2, error_code, 0); | 1369 | er = emulate_instruction(vcpu, vcpu->run, cr2, error_code, 0); |
1366 | mutex_unlock(&vcpu->kvm->lock); | 1370 | mutex_unlock(&vcpu->kvm->lock); |
1367 | 1371 | ||