[patch] bugfix, correct itc_offset calculations

Jes Sorensen <[email protected]>
Newsgroups org.kernel.vger.kvm-ia64
Message-ID <[email protected]>
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
4000-kvm-ia64-itc-init.patch (text/x-patch, 810 B)
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 <[email protected]>

---
 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;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.