From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: KVM: x86: update masterclock when kvmclock_offset is calculated Date: Fri, 23 Aug 2013 12:00:46 +0200 Message-ID: <521732CE.9070309@redhat.com> References: <20130820182012.GA814@amt.cnet> <521644D0.9050902@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Marcelo Tosatti , kvm-devel , Gleb Natapov To: unlisted-recipients:; (no To-header on input) Return-path: Received: from mail-ee0-f52.google.com ([74.125.83.52]:48438 "EHLO mail-ee0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753968Ab3HWKBc (ORCPT ); Fri, 23 Aug 2013 06:01:32 -0400 Received: by mail-ee0-f52.google.com with SMTP id c41so192946eek.39 for ; Fri, 23 Aug 2013 03:01:31 -0700 (PDT) In-Reply-To: <521644D0.9050902@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Il 22/08/2013 19:05, Paolo Bonzini ha scritto: > Il 20/08/2013 20:20, Marcelo Tosatti ha scritto: >> >> The offset to add to the hosts monotonic time, kvmclock_offset, is >> calculated against the monotonic time at KVM_SET_CLOCK ioctl time. >> >> Request a master clock update at this time, to reduce a potentially >> unbounded difference between the values of the masterclock and >> the clock value used to calculate kvmclock_offset. >> >> Signed-off-by: Marcelo Tosatti >> >> Index: linux-2.6-kvmclock-fixes/arch/x86/kvm/x86.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- linux-2.6-kvmclock-fixes.orig/arch/x86/kvm/x86.c >> +++ linux-2.6-kvmclock-fixes/arch/x86/kvm/x86.c >> @@ -3806,6 +3806,7 @@ long kvm_arch_vm_ioctl(struct file *filp >> delta =3D user_ns.clock - now_ns; >> local_irq_enable(); >> kvm->arch.kvmclock_offset =3D delta; >> + kvm_gen_update_masterclock(kvm); >> break; >> } >> case KVM_GET_CLOCK: { >=20 > Reviewed-by: Paolo Bonzini Actually, what commit is this patch based on? You are calling the=20 function at line 3799, but it is only declared at line 5786, and this=20 causes: /root/kvm-kmod/x86/x86.c: In function =91kvm_arch_vm_ioctl=92: /root/kvm-kmod/x86/x86.c:3799:3: error: implicit declaration of functio= n =91kvm_gen_update_masterclock=92 /root/kvm-kmod/x86/x86.c: At top level: /root/kvm-kmod/x86/x86.c:5786:13: warning: conflicting types for =91kvm= _gen_update_masterclock=92 /root/kvm-kmod/x86/x86.c:5786:13: error: static declaration of =91kvm_g= en_update_masterclock=92 follows non-static declaration /root/kvm-kmod/x86/x86.c:3799:3: note: previous implicit declaration of= =91kvm_gen_update_masterclock=92 was here Paolo