aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/vmx.c
diff options
context:
space:
mode:
authorShaohua Li <shaohua.li@intel.com>2007-07-23 02:51:37 -0400
committerAvi Kivity <avi@qumranet.com>2007-10-13 04:18:20 -0400
commit11ec2804711896546ee3c945f3786c7f9fdd175a (patch)
tree1e26102931efb8b0b48c440887577d21170ef94a /drivers/kvm/vmx.c
parent15ad71460d75fd7ca41bb248a2310f3f39b302ba (diff)
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)
1711 if (is_page_fault(intr_info)) { 1711 if (is_page_fault(intr_info)) {
1712 cr2 = vmcs_readl(EXIT_QUALIFICATION); 1712 cr2 = vmcs_readl(EXIT_QUALIFICATION);
1713 1713
1714 spin_lock(&vcpu->kvm->lock); 1714 mutex_lock(&vcpu->kvm->lock);
1715 r = kvm_mmu_page_fault(vcpu, cr2, error_code); 1715 r = kvm_mmu_page_fault(vcpu, cr2, error_code);
1716 if (r < 0) { 1716 if (r < 0) {
1717 spin_unlock(&vcpu->kvm->lock); 1717 mutex_unlock(&vcpu->kvm->lock);
1718 return r; 1718 return r;
1719 } 1719 }
1720 if (!r) { 1720 if (!r) {
1721 spin_unlock(&vcpu->kvm->lock); 1721 mutex_unlock(&vcpu->kvm->lock);
1722 return 1; 1722 return 1;
1723 } 1723 }
1724 1724
1725 er = emulate_instruction(vcpu, kvm_run, cr2, error_code); 1725 er = emulate_instruction(vcpu, kvm_run, cr2, error_code);
1726 spin_unlock(&vcpu->kvm->lock); 1726 mutex_unlock(&vcpu->kvm->lock);
1727 1727
1728 switch (er) { 1728 switch (er) {
1729 case EMULATE_DONE: 1729 case EMULATE_DONE: