KVM: ia64: Correct itc_offset calculations
authorJes Sorensen <jes@sgi.com>
Mon, 25 May 2009 08:22:17 +0000 (10:22 +0200)
committerAvi Kivity <avi@redhat.com>
Thu, 10 Sep 2009 05:32:42 +0000 (08:32 +0300)
Init the itc_offset for all possible vCPUs. The current code by
mistake ends up only initializing the offset on vCPU 0.

Spotted by Gleb Natapov.

Signed-off-by: Jes Sorensen <jes@sgi.com>
Acked-by : Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/ia64/kvm/kvm-ia64.c

index 80c57b0a21c479ee593fb095bc8429089eced2f5..319922137fddece92552d55f395d2c9b5cc66871 100644 (file)
@@ -1224,7 +1224,7 @@ int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu)
 
                /*Initialize itc offset for vcpus*/
                itc_offset = 0UL - kvm_get_itc(vcpu);
-               for (i = 0; i < kvm->arch.online_vcpus; i++) {
+               for (i = 0; i < KVM_MAX_VCPUS; i++) {
                        v = (struct kvm_vcpu *)((char *)vcpu +
                                        sizeof(struct kvm_vcpu_data) * i);
                        v->arch.itc_offset = itc_offset;