From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fernando Luis =?ISO-8859-1?Q?V=E1zquez?= Cao Subject: [PATCH 2/2] target-i386: do not special case TSC writeback Date: Fri, 06 Dec 2013 17:38:24 +0900 Message-ID: <1386319104.20542.1.camel@nexus> References: <1386054500.25757.10.camel@nexus> <529D90A6.2080801@lab.ntt.co.jp> <52A0186A.2050207@lab.ntt.co.jp> <1386224104.3091.3.camel@nexus> <52A04732.4040105@redhat.com> <52A07C5A.9090105@lab.ntt.co.jp> <52A08541.6090702@redhat.com> <52A09EF4.5080800@lab.ntt.co.jp> <20131205161707.GB17277@amt.cnet> <52A0AC09.4090202@redhat.com> <52A189B2.4060305@lab.ntt.co.jp> <1386318781.20106.3.camel@nexus> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: Gleb Natapov , Will Auld , Marcelo Tosatti , qemu-devel@nongnu.org, kvm@vger.kernel.org To: Paolo Bonzini Return-path: Received: from tama500.ecl.ntt.co.jp ([129.60.39.148]:38402 "EHLO tama500.ecl.ntt.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754035Ab3LFIie (ORCPT ); Fri, 6 Dec 2013 03:38:34 -0500 In-Reply-To: <1386318781.20106.3.camel@nexus> Sender: kvm-owner@vger.kernel.org List-ID: Newer kernels are capable of synchronizing TSC values of multiple VCPUs on writeback, but we were excluding the power up case, which is not needed anymore. Signed-off-by: Fernando Luis Vazquez Cao --- diff -urNp qemu-orig/target-i386/kvm.c qemu/target-i386/kvm.c --- qemu-orig/target-i386/kvm.c 2013-12-06 16:12:03.201953736 +0900 +++ qemu/target-i386/kvm.c 2013-12-06 16:13:53.897955184 +0900 @@ -1144,15 +1144,7 @@ static int kvm_put_msrs(X86CPU *cpu, int * for normal writeback. Limit them to reset or full state updates. */ if (level >= KVM_PUT_RESET_STATE) { - /* - * 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 || level == KVM_PUT_RESET_STATE) { - kvm_msr_entry_set(&msrs[n++], MSR_IA32_TSC, env->tsc); - } + 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);