From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33176) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X9aed-0008RT-GZ for qemu-devel@nongnu.org; Tue, 22 Jul 2014 10:02:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X9aeV-0007co-Oa for qemu-devel@nongnu.org; Tue, 22 Jul 2014 10:02:55 -0400 Received: from zimbra3.corp.accelance.fr ([2001:4080:204::2:8]:54000) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X9aeV-0007cH-I5 for qemu-devel@nongnu.org; Tue, 22 Jul 2014 10:02:47 -0400 Date: Tue, 22 Jul 2014 16:02:41 +0200 (CEST) From: Sebastian Tanase Message-ID: <47507527.20044186.1406037761337.JavaMail.root@openwide.fr> In-Reply-To: <53C67C00.5000203@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC PATCH V4 0/6] icount: Implement delay algorithm between guest and host clocks List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: kwolf@redhat.com, peter maydell , aliguori@amazon.com, wenchaoqemu@gmail.com, quintela@redhat.com, qemu-devel@nongnu.org, mst@redhat.com, stefanha@redhat.com, armbru@redhat.com, lcapitulino@redhat.com, michael@walle.cc, camille begue , alex@alex.org.uk, crobinso@redhat.com, afaerber@suse.de, rth@twiddle.net ----- Mail original ----- > De: "Paolo Bonzini" > =C3=80: "Sebastian Tanase" , qemu-devel@non= gnu.org > Cc: aliguori@amazon.com, afaerber@suse.de, rth@twiddle.net, "peter maydel= l" , > michael@walle.cc, alex@alex.org.uk, stefanha@redhat.com, lcapitulino@redh= at.com, crobinso@redhat.com, > armbru@redhat.com, wenchaoqemu@gmail.com, quintela@redhat.com, kwolf@redh= at.com, mst@redhat.com, "camille begue" > > Envoy=C3=A9: Mercredi 16 Juillet 2014 15:20:00 > Objet: Re: [RFC PATCH V4 0/6] icount: Implement delay algorithm between g= uest and host clocks >=20 > Il 16/07/2014 14:18, Sebastian Tanase ha scritto: > > v3 -> v4 > > > > * Add better error handling for 'strtol' in patch 2 > > * Add 'Sleep' instead of 'nanosleep' for Windows hosts in patch 4 > > * Remove function pointers from patches 4 and 5 >=20 > Hi Sebastian, I think we're getting really close. >=20 > I asked a question about clocks_offset; I think it's not necessary to > compute it in cpu-exec.c because the same information is available > elsewhere. It is also probably not necessary to make it public. Can > you please check this? Once this is sorted out, the patch should be > ready for inclusion in 2.2. >=20 > Thanks for your effort! >=20 > Paolo >=20 Hello, Supposing the patch that changes vm_clock_warp_start from 0 to -1 is accept= ed, I could use the information in timers_state.cpu_clock_offset instead of rec= alculating the offset. Besides, given that I only need this particular field from the = whole=20 structure, I think I don't have to make timers_state public; I could add a = function=20 in cpus.c, for example: int64_t cpu_get_clock_offset(void) { int64_t ti; unsigned start; do { start =3D seqlock_read_begin(&timers_state.vm_clock_seqlock); ti =3D -timers_state.cpu_clock_offset; } while (seqlock_read_retry(&timers_state.vm_clock_seqlock, start))= ; return ti; } that will return the cpu_clock_offset field. Best regards, Sebastian