repository: /home/avi/kvm/linux-2.6
branch: master
commit 3b06c8ee1e0710c99c2b34a3c34c9758256a6248
Author: Avi Kivity <[EMAIL PROTECTED]>
Date:   Sun Oct 21 09:45:12 2007 +0200

    Revert "KVM: VMX: Initialize vcpu with preemption enabled"
    
    This reverts commit 341131670f028f8bec97db6121c018f53129b9c3.  It executes
    vcpu_load() before installing the preemption notifier, which leeds to 
oopses.
    
    Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>

diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index 01f3b25..e8a07d7 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -188,7 +188,6 @@ 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)
 {
@@ -198,7 +197,6 @@ 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 4e8ee36..4690433 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -2424,6 +2424,7 @@ 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,9 +2449,11 @@ static struct kvm_vcpu *vmx_create_vcpu(struct kvm *kvm, 
unsigned int id)
 
        vmcs_clear(vmx->vmcs);
 
-       vcpu_load(&vmx->vcpu);
+       cpu = get_cpu();
+       vmx_vcpu_load(&vmx->vcpu, cpu);
        err = vmx_vcpu_setup(vmx);
-       vcpu_put(&vmx->vcpu);
+       vmx_vcpu_put(&vmx->vcpu);
+       put_cpu();
        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

Reply via email to