KVM: SVM: Fix SMP with kernel apic
authorAvi Kivity <avi@qumranet.com>
Wed, 7 Nov 2007 10:57:23 +0000 (12:57 +0200)
committerAvi Kivity <avi@qumranet.com>
Thu, 8 Nov 2007 10:05:36 +0000 (12:05 +0200)
AP processor needs to reset to the SIPI vector, not normal INIT.

Signed-off-by: Avi Kivity <avi@qumranet.com>
drivers/kvm/svm.c

index 729f1cd93606e86315b0330e0c2af7c740b22de6..3910358db79defe9cff19fe95bd36b375f81de98 100644 (file)
@@ -561,6 +561,12 @@ static void svm_vcpu_reset(struct kvm_vcpu *vcpu)
        struct vcpu_svm *svm = to_svm(vcpu);
 
        init_vmcb(svm->vmcb);
+
+       if (vcpu->vcpu_id != 0) {
+               svm->vmcb->save.rip = 0;
+               svm->vmcb->save.cs.base = svm->vcpu.sipi_vector << 12;
+               svm->vmcb->save.cs.selector = svm->vcpu.sipi_vector << 8;
+       }
 }
 
 static struct kvm_vcpu *svm_create_vcpu(struct kvm *kvm, unsigned int id)