repository: /home/avi/kvm/linux-2.6 branch: master commit 341131670f028f8bec97db6121c018f53129b9c3 Author: Avi Kivity <[EMAIL PROTECTED]> Date: Thu Oct 18 12:38:52 2007 +0200
KVM: VMX: Initialize vcpu with preemption enabled vcpu initialization require writes to memory (for the real mode tss), which is now a sleeping operation. Signed-off-by: Avi Kivity <[EMAIL PROTECTED]> diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c index 0d2ccfe..c84bbea 100644 --- a/drivers/kvm/kvm_main.c +++ b/drivers/kvm/kvm_main.c @@ -187,6 +187,7 @@ void vcpu_load(struct kvm_vcpu *vcpu) kvm_arch_vcpu_load(vcpu, cpu); put_cpu(); } +EXPORT_SYMBOL_GPL(vcpu_load); void vcpu_put(struct kvm_vcpu *vcpu) { @@ -196,6 +197,7 @@ void vcpu_put(struct kvm_vcpu *vcpu) preempt_enable(); mutex_unlock(&vcpu->mutex); } +EXPORT_SYMBOL_GPL(vcpu_put); static void ack_flush(void *_completed) { diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c index c8b8045..244f6a6 100644 --- a/drivers/kvm/vmx.c +++ b/drivers/kvm/vmx.c @@ -2423,7 +2423,6 @@ static struct kvm_vcpu *vmx_create_vcpu(struct kvm *kvm, unsigned int id) { int err; struct vcpu_vmx *vmx = kmem_cache_zalloc(kvm_vcpu_cache, GFP_KERNEL); - int cpu; if (!vmx) return ERR_PTR(-ENOMEM); @@ -2448,11 +2447,9 @@ static struct kvm_vcpu *vmx_create_vcpu(struct kvm *kvm, unsigned int id) vmcs_clear(vmx->vmcs); - cpu = get_cpu(); - vmx_vcpu_load(&vmx->vcpu, cpu); + vcpu_load(&vmx->vcpu); err = vmx_vcpu_setup(vmx); - vmx_vcpu_put(&vmx->vcpu); - put_cpu(); + vcpu_put(&vmx->vcpu); if (err) goto free_vmcs; ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ kvm-commits mailing list kvm-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-commits