From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: KVM: x86: update masterclock when kvmclock_offset is calculated Date: Tue, 27 Aug 2013 23:55:57 -0300 Message-ID: <20130828025557.GC13653@amt.cnet> References: <20130820182012.GA814@amt.cnet> <521644D0.9050902@redhat.com> <521732CE.9070309@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvm-devel , Gleb Natapov To: Paolo Bonzini Return-path: Received: from mx1.redhat.com ([209.132.183.28]:25483 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752784Ab3H1D2G (ORCPT ); Tue, 27 Aug 2013 23:28:06 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r7S3S5TF020567 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 27 Aug 2013 23:28:05 -0400 Content-Disposition: inline In-Reply-To: <521732CE.9070309@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Fri, Aug 23, 2013 at 12:00:46PM +0200, Paolo Bonzini wrote: > 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 potentiall= y > >> 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 >=20 > 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: >=20 > /root/kvm-kmod/x86/x86.c: In function =E2=80=98kvm_arch_vm_ioctl=E2=80= =99: > /root/kvm-kmod/x86/x86.c:3799:3: error: implicit declaration of funct= ion =E2=80=98kvm_gen_update_masterclock=E2=80=99 > /root/kvm-kmod/x86/x86.c: At top level: > /root/kvm-kmod/x86/x86.c:5786:13: warning: conflicting types for =E2=80= =98kvm_gen_update_masterclock=E2=80=99 > /root/kvm-kmod/x86/x86.c:5786:13: error: static declaration of =E2=80= =98kvm_gen_update_masterclock=E2=80=99 follows non-static declaration > /root/kvm-kmod/x86/x86.c:3799:3: note: previous implicit declaration = of =E2=80=98kvm_gen_update_masterclock=E2=80=99 was here >=20 > Paolo Wrong tree, my bad, sorry Paolo (sent v2).