----- Mail original ----- > De: "Paolo Bonzini" <pbonz...@redhat.com> > À: "Sebastian Tanase" <sebastian.tan...@openwide.fr>, qemu-devel@nongnu.org > Cc: aligu...@amazon.com, afaer...@suse.de, r...@twiddle.net, "peter maydell" > <peter.mayd...@linaro.org>, > mich...@walle.cc, a...@alex.org.uk, stefa...@redhat.com, > lcapitul...@redhat.com, crobi...@redhat.com, > arm...@redhat.com, wenchaoq...@gmail.com, quint...@redhat.com, > kw...@redhat.com, m...@redhat.com, "camille begue" > <camille.be...@openwide.fr> > Envoyé: Mercredi 16 Juillet 2014 15:20:00 > Objet: Re: [RFC PATCH V4 0/6] icount: Implement delay algorithm between guest > and host clocks > > 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 > > Hi Sebastian, I think we're getting really close. > > 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. > > Thanks for your effort! > > Paolo >
Hello, Supposing the patch that changes vm_clock_warp_start from 0 to -1 is accepted, I could use the information in timers_state.cpu_clock_offset instead of recalculating the offset. Besides, given that I only need this particular field from the whole structure, I think I don't have to make timers_state public; I could add a function in cpus.c, for example: int64_t cpu_get_clock_offset(void) { int64_t ti; unsigned start; do { start = seqlock_read_begin(&timers_state.vm_clock_seqlock); ti = -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