[patch] bugfix, correct itc_offset calculations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



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.


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@xxxxxxx>

 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;

[Index of Archives]     [Linux KVM Devel]     [Linux Virtualization]     [Big List of Linux Books]     [Linux SCSI]     [Yosemite Forum]

  Powered by Linux