summaryrefslogtreecommitdiffstats
path: root/drivers/kvm/vmx.c
diff options
context:
space:
mode:
authorShaohua Li <shaohua.li@intel.com>2007-07-23 08:51:37 +0200
committerAvi Kivity <avi@qumranet.com>2007-10-13 10:18:20 +0200
commit11ec2804711896546ee3c945f3786c7f9fdd175a (patch)
tree1e26102931efb8b0b48c440887577d21170ef94a /drivers/kvm/vmx.c
parentKVM: Use the scheduler preemption notifiers to make kvm preemptible (diff)
downloadlinux-11ec2804711896546ee3c945f3786c7f9fdd175a.tar.xz
linux-11ec2804711896546ee3c945f3786c7f9fdd175a.zip
KVM: Convert vm lock to a mutex
This allows the kvm mmu to perform sleepy operations, such as memory allocation. Signed-off-by: Shaohua Li <shaohua.li@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/vmx.c')
-rw-r--r--drivers/kvm/vmx.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index 8c87d20f8e39..5b77d9b7b1ac 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -1711,19 +1711,19 @@ static int handle_exception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
if (is_page_fault(intr_info)) {
cr2 = vmcs_readl(EXIT_QUALIFICATION);
- spin_lock(&vcpu->kvm->lock);
+ mutex_lock(&vcpu->kvm->lock);
r = kvm_mmu_page_fault(vcpu, cr2, error_code);
if (r < 0) {
- spin_unlock(&vcpu->kvm->lock);
+ mutex_unlock(&vcpu->kvm->lock);
return r;
}
if (!r) {
- spin_unlock(&vcpu->kvm->lock);
+ mutex_unlock(&vcpu->kvm->lock);
return 1;
}
er = emulate_instruction(vcpu, kvm_run, cr2, error_code);
- spin_unlock(&vcpu->kvm->lock);
+ mutex_unlock(&vcpu->kvm->lock);
switch (er) {
case EMULATE_DONE: