From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH v2] KVM: x86: fix KVM_SET_CLOCK relative to setting correct clock value Date: Fri, 12 May 2017 16:36:08 +0200 Message-ID: <10dd7086-e156-a2ad-900b-48c63da6a813@redhat.com> References: <20170502213616.GA24837@amt.cnet> <2499ef65-1dfe-8460-ec41-661b05cc5023@redhat.com> <20170503134341.GB10468@amt.cnet> <20170510180430.GA2240@potion> <20170511153903.GC2308@amt.cnet> <20170512141322.GC2173@potion> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: kvm-devel To: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Marcelo Tosatti Return-path: Received: from mx1.redhat.com ([209.132.183.28]:35844 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756019AbdELOgM (ORCPT ); Fri, 12 May 2017 10:36:12 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 44EE680F90 for ; Fri, 12 May 2017 14:36:12 +0000 (UTC) In-Reply-To: <20170512141322.GC2173@potion> Content-Language: en-US Sender: kvm-owner@vger.kernel.org List-ID: On 12/05/2017 16:13, Radim Krčmář wrote: > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > index 464da936c53d..8db1d09e59d7 100644 > --- a/arch/x86/kvm/x86.c > +++ b/arch/x86/kvm/x86.c > @@ -4175,9 +4175,10 @@ long kvm_arch_vm_ioctl(struct file *filp, > goto out; > > r = 0; > + kvm_gen_update_masterclock(kvm); > now_ns = get_kvmclock_ns(kvm); > kvm->arch.kvmclock_offset += user_ns.clock - now_ns; > - kvm_gen_update_masterclock(kvm); > + kvm_make_all_cpus_request(kvm, KVM_REQ_CLOCK_UPDATE); > break; > } > case KVM_GET_CLOCK: { And then I think the first kvm_gen_update_masterclock should be modified to skip sending the KVM_REQ_CLOCK_UPDATE request. Paolo