]> Git Repo - qemu.git/commitdiff
kvm: writeback SMP TSCs on migration only
authorMarcelo Tosatti <[email protected]>
Thu, 21 Oct 2010 15:35:03 +0000 (13:35 -0200)
committerMarcelo Tosatti <[email protected]>
Thu, 21 Oct 2010 15:37:40 +0000 (13:37 -0200)
commit 6389c45441269baa2873e6feafebd17105ddeaf6
Author: Jan Kiszka <[email protected]>
Date:   Mon Mar 1 18:17:26 2010 +0100

    qemu-kvm: Cleanup/fix TSC and PV clock writeback

Signed-off-by: Marcelo Tosatti <[email protected]>
target-i386/kvm.c

index 06474d6161baa4d39006e1aefdc48a7529b229c1..e2f7e2ef4a9ddc0ccaf9511e5d1d53e9c3471b6c 100644 (file)
@@ -817,7 +817,15 @@ static int kvm_put_msrs(CPUState *env, int level)
     kvm_msr_entry_set(&msrs[n++], MSR_LSTAR, env->lstar);
 #endif
     if (level == KVM_PUT_FULL_STATE) {
-        kvm_msr_entry_set(&msrs[n++], MSR_IA32_TSC, env->tsc);
+        /*
+         * KVM is yet unable to synchronize TSC values of multiple VCPUs on
+         * writeback. Until this is fixed, we only write the offset to SMP
+         * guests after migration, desynchronizing the VCPUs, but avoiding
+         * huge jump-backs that would occur without any writeback at all.
+         */
+        if (smp_cpus == 1 || env->tsc != 0) {
+            kvm_msr_entry_set(&msrs[n++], MSR_IA32_TSC, env->tsc);
+        }
         kvm_msr_entry_set(&msrs[n++], MSR_KVM_SYSTEM_TIME,
                           env->system_time_msr);
         kvm_msr_entry_set(&msrs[n++], MSR_KVM_WALL_CLOCK, env->wall_clock_msr);
This page took 0.029039 seconds and 4 git commands to generate.