Re: [Qemu-devel] [PATCH 2/2] [RFC] time: refactor QEMU timer to use GHRTimer

2011-08-23 Thread Paolo Bonzini
On 08/23/2011 02:33 PM, Anthony Liguori wrote: cpu_get_ticks is used also to emulate the guest TSC, are you sure you want to change that uniformly to a 1 GHz rate? Where possible, CLOCK_MONOTONIC_RAW should be implemented in terms or rdtscp. It will provide the highest accuracy time source tha

Re: [Qemu-devel] [PATCH 2/2] [RFC] time: refactor QEMU timer to use GHRTimer

2011-08-23 Thread Anthony Liguori
On 08/23/2011 02:43 AM, Paolo Bonzini wrote: On 08/22/2011 09:21 PM, Anthony Liguori wrote: - ticks = cpu_get_real_ticks(); - if (timers_state.cpu_ticks_prev > ticks) { - /* Note: non increasing ticks may happen if the host uses - software suspend */ - timers_state.cpu_ticks_offset += timers_sta

Re: [Qemu-devel] [PATCH 2/2] [RFC] time: refactor QEMU timer to use GHRTimer

2011-08-23 Thread Edgar E. Iglesias
On Tue, Aug 23, 2011 at 10:12:05AM +0200, Paolo Bonzini wrote: > On 08/22/2011 10:28 PM, Jan Kiszka wrote: > > - QEMU_CLOCK_VIRTUAL: Without -icount, same as above, but stops when > > the guest is stopped. The offset to compensate for stopped > > times is based on TSC, not sure why. With

Re: [Qemu-devel] [PATCH 2/2] [RFC] time: refactor QEMU timer to use GHRTimer

2011-08-23 Thread Paolo Bonzini
On 08/22/2011 10:28 PM, Jan Kiszka wrote: - QEMU_CLOCK_VIRTUAL: Without -icount, same as above, but stops when the guest is stopped. The offset to compensate for stopped times is based on TSC, not sure why. With -icount, things get more complicated, Paolo had some nice explanations

Re: [Qemu-devel] [PATCH 2/2] [RFC] time: refactor QEMU timer to use GHRTimer

2011-08-23 Thread Paolo Bonzini
On 08/22/2011 09:21 PM, Anthony Liguori wrote: -ticks = cpu_get_real_ticks(); -if (timers_state.cpu_ticks_prev > ticks) { -/* Note: non increasing ticks may happen if the host uses - software suspend */ -timers_state.cpu_ticks_offset += timers

Re: [Qemu-devel] [PATCH 2/2] [RFC] time: refactor QEMU timer to use GHRTimer

2011-08-22 Thread Jan Kiszka
On 2011-08-22 23:55, Anthony Liguori wrote: These two assessments are partly just wrong, partly fail to see the real use case. QEMU_CLOCK_HOST serves the very valid scenarios where a guest clock shall be kept synchronized on the host time, also following its jumps according

Re: [Qemu-devel] [PATCH 2/2] [RFC] time: refactor QEMU timer to use GHRTimer

2011-08-22 Thread Anthony Liguori
On 08/22/2011 03:49 PM, Jan Kiszka wrote: On 2011-08-22 22:36, Anthony Liguori wrote: On 08/22/2011 03:28 PM, Jan Kiszka wrote: On 2011-08-22 21:21, Anthony Liguori wrote: This replaces all of the QEMU timer code with GHRTimer, dramatically simplifying time keeping in QEMU while making it poss

Re: [Qemu-devel] [PATCH 2/2] [RFC] time: refactor QEMU timer to use GHRTimer

2011-08-22 Thread Jan Kiszka
On 2011-08-22 22:36, Anthony Liguori wrote: > On 08/22/2011 03:28 PM, Jan Kiszka wrote: >> On 2011-08-22 21:21, Anthony Liguori wrote: >>> This replaces all of the QEMU timer code with GHRTimer, dramatically >>> simplifying >>> time keeping in QEMU while making it possible to use QEMUTimer code >>>

Re: [Qemu-devel] [PATCH 2/2] [RFC] time: refactor QEMU timer to use GHRTimer

2011-08-22 Thread Anthony Liguori
On 08/22/2011 03:28 PM, Jan Kiszka wrote: On 2011-08-22 21:21, Anthony Liguori wrote: This replaces all of the QEMU timer code with GHRTimer, dramatically simplifying time keeping in QEMU while making it possible to use QEMUTimer code outside of the main loop. The later is critical to building

Re: [Qemu-devel] [PATCH 2/2] [RFC] time: refactor QEMU timer to use GHRTimer

2011-08-22 Thread Jan Kiszka
On 2011-08-22 21:21, Anthony Liguori wrote: > This replaces all of the QEMU timer code with GHRTimer, dramatically > simplifying > time keeping in QEMU while making it possible to use QEMUTimer code outside of > the main loop. The later is critical to building unit tests. > > This is an RFC beca

[Qemu-devel] [PATCH 2/2] [RFC] time: refactor QEMU timer to use GHRTimer

2011-08-22 Thread Anthony Liguori
This replaces all of the QEMU timer code with GHRTimer, dramatically simplifying time keeping in QEMU while making it possible to use QEMUTimer code outside of the main loop. The later is critical to building unit tests. This is an RFC because I'm sure this breaks things as it changes things. QE