From: Jes Sorensen Date: Mon, 25 May 2009 08:22:17 +0000 Subject: [patch] bugfix, correct itc_offset calculations Message-Id: <4A1A5539.4030500@sgi.com> MIME-Version: 1 Content-Type: multipart/mixed; boundary="------------050205090609060304010106" List-Id: To: kvm-ia64@vger.kernel.org This is a multi-part message in MIME format. --------------050205090609060304010106 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi, Gleb Natapov spotted that I had been a little over aggressive when I introduced the vcpu_online counter, so the code in kvm_arch_vcpu_init() only calculated the itc_offset for vCPU 0. Please apply. Cheers, Jes --------------050205090609060304010106 Content-Type: text/x-patch; name="4000-kvm-ia64-itc-init.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="4000-kvm-ia64-itc-init.patch" 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 --- arch/ia64/kvm/kvm-ia64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux-2.6.git/arch/ia64/kvm/kvm-ia64.c =================================================================== --- linux-2.6.git.orig/arch/ia64/kvm/kvm-ia64.c +++ linux-2.6.git/arch/ia64/kvm/kvm-ia64.c @@ -1166,7 +1166,7 @@ /*Initialize itc offset for vcpus*/ itc_offset = 0UL - ia64_getreg(_IA64_REG_AR_ITC); - 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; --------------050205090609060304010106--