aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvi Kivity <avi@qumranet.com>2007-10-28 18:52:05 +0200
committerAvi Kivity <avi@qumranet.com>2007-10-28 18:52:05 +0200
commitb95061aec006bc4c44e4b244e4ec15c009ab880a (patch)
treed17640ba4e34a03d4efcda935ca7a699c83ba60b
parente9e1741b896e474238422b3954eb05ff06075d61 (diff)
KVM: MMU: Topup the mmu memory preallocation caches before emulating an insnkvm-49
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.c4
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)
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);