diff options
author | Shaohua Li <shaohua.li@intel.com> | 2007-07-23 02:51:37 -0400 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2007-10-13 04:18:20 -0400 |
commit | 11ec2804711896546ee3c945f3786c7f9fdd175a (patch) | |
tree | 1e26102931efb8b0b48c440887577d21170ef94a /drivers/kvm/svm.c | |
parent | 15ad71460d75fd7ca41bb248a2310f3f39b302ba (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/svm.c')
-rw-r--r-- | drivers/kvm/svm.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c index 3997bbd78fb7..9a840e08b207 100644 --- a/drivers/kvm/svm.c +++ b/drivers/kvm/svm.c | |||
@@ -941,21 +941,21 @@ static int pf_interception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) | |||
941 | if (is_external_interrupt(exit_int_info)) | 941 | if (is_external_interrupt(exit_int_info)) |
942 | push_irq(vcpu, exit_int_info & SVM_EVTINJ_VEC_MASK); | 942 | push_irq(vcpu, exit_int_info & SVM_EVTINJ_VEC_MASK); |
943 | 943 | ||
944 | spin_lock(&vcpu->kvm->lock); | 944 | mutex_lock(&vcpu->kvm->lock); |
945 | 945 | ||
946 | fault_address = svm->vmcb->control.exit_info_2; | 946 | fault_address = svm->vmcb->control.exit_info_2; |
947 | error_code = svm->vmcb->control.exit_info_1; | 947 | error_code = svm->vmcb->control.exit_info_1; |
948 | r = kvm_mmu_page_fault(vcpu, fault_address, error_code); | 948 | r = kvm_mmu_page_fault(vcpu, fault_address, error_code); |
949 | if (r < 0) { | 949 | if (r < 0) { |
950 | spin_unlock(&vcpu->kvm->lock); | 950 | mutex_unlock(&vcpu->kvm->lock); |
951 | return r; | 951 | return r; |
952 | } | 952 | } |
953 | if (!r) { | 953 | if (!r) { |
954 | spin_unlock(&vcpu->kvm->lock); | 954 | mutex_unlock(&vcpu->kvm->lock); |
955 | return 1; | 955 | return 1; |
956 | } | 956 | } |
957 | er = emulate_instruction(vcpu, kvm_run, fault_address, error_code); | 957 | er = emulate_instruction(vcpu, kvm_run, fault_address, error_code); |
958 | spin_unlock(&vcpu->kvm->lock); | 958 | mutex_unlock(&vcpu->kvm->lock); |
959 | 959 | ||
960 | switch (er) { | 960 | switch (er) { |
961 | case EMULATE_DONE: | 961 | case EMULATE_DONE: |