From: Jes Sorensen Date: Mon, 25 May 2009 08:22:17 +0000 (+0200) Subject: KVM: ia64: Correct itc_offset calculations X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3032b925f00ba2653f7695d356d6f8284c82038d;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git KVM: ia64: Correct itc_offset calculations 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 Acked-by : Xiantao Zhang Signed-off-by: Avi Kivity --- diff --git a/arch/ia64/kvm/kvm-ia64.c b/arch/ia64/kvm/kvm-ia64.c index 80c57b0a21c4..319922137fdd 100644 --- a/arch/ia64/kvm/kvm-ia64.c +++ b/arch/ia64/kvm/kvm-ia64.c @@ -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;