Skip to contentSkip to conversation

bugfix, correct itc_offset calculations

PATCH Applied Jes Sorensen 3 participants 3 messages May 25, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bugfix, correct itc_offset calculations

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

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

---
 arch/ia64/kvm/kvm-ia64.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/ia64/kvm/kvm-ia64.c +1 -1
Index: 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;
Acked-by on v1 1/1
#1 lore raw

Aha, it should be introduced when implement vcpu_online mechanism.

Xiantao

Quoted 10 lines · Jes Sorensen

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

Applied
#2 lore raw
In reply to Jes Sorensen
Quoted 5 lines · Jes Sorensen

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.

Applied, thanks.

Signature · 1 line
error compiling committee.c: too many arguments to function