qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC 0/3] Determinitic behaviour with icount.
@ 2013-07-18 15:02 fred.konrad
  2013-07-18 15:02 ` [Qemu-devel] [RFC 1/3] icount: base rt_clock on icount fred.konrad
                   ` (3 more replies)
  0 siblings, 4 replies; 18+ messages in thread
From: fred.konrad @ 2013-07-18 15:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, mark.burton, fred.konrad

From: KONRAD Frederic <fred.konrad@greensocs.com>

Hi everybody,

As I said in the last email, we have issues with determinism with icount.
We are wondering if determinism is really ensured with icount?

We saw that the rt_clock is used at multiple place which is a pain for
replaying the simulation the same way. So we simply base rt_clock on icount.

When the cpu is idle vm_clock is synchronized with the host clock which is bad
for determinism, and this happen regularly in time even if there are no I/O.
We choose to synchronize vm_clock on the next event to make sure the vm will
restart, and to avoid non determinism.

Is this the right think to do?

An other issue:

A timer callback is triggered to make the snapshot regularly. Unfortunately this
was not at all regular. For example: if we use step function in GDB instead of
cont, the callback will be triggered more often.

So we :
    * created a new clock (ic_clock) based only on icount without the bias.
    * and we repaired icount_extra mechanism by computing it from ic_clock.

Then the snapshot are taken regularly with or without stepping in gdb, the timer
became accurate and call the callback at the exact ic_clock time.

Both icount and reverse execution need an instruction counter. icount use a
count-down mechanism but reverse execution need a continuous counter. For now
we have build a separate counter and we think that these two counters can be
merged. However we would like feedback about this before modifying this.

Adding these features has moved us forward, but - QEMU is STILL not
deterministic - we believe this is likely due to I/O which we will start
investigating next.

Fred

KONRAD Frederic (3):
  icount: base rt_clock on icount.
  icount: sync vm_clock on the next event.
  icount: create a new icount based timer.

 cpus.c               | 21 +++++++++++++++++----
 include/qemu/timer.h |  4 ++++
 main-loop.c          |  5 +++++
 qemu-timer.c         | 12 +++++++++++-
 4 files changed, 37 insertions(+), 5 deletions(-)

-- 
1.8.1.4

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2013-07-30  7:06 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-18 15:02 [Qemu-devel] [RFC 0/3] Determinitic behaviour with icount fred.konrad
2013-07-18 15:02 ` [Qemu-devel] [RFC 1/3] icount: base rt_clock on icount fred.konrad
2013-07-18 15:36   ` Paolo Bonzini
2013-07-18 16:23     ` Frederic Konrad
2013-07-18 16:26       ` Paolo Bonzini
2013-07-18 15:02 ` [Qemu-devel] [RFC 2/3] icount: sync vm_clock on the next event fred.konrad
2013-07-18 15:02 ` [Qemu-devel] [RFC 3/3] icount: create a new icount based timer fred.konrad
2013-07-18 15:08   ` Peter Maydell
2013-07-18 15:06 ` [Qemu-devel] [RFC 0/3] Determinitic behaviour with icount Peter Maydell
2013-07-18 15:09   ` Frederic Konrad
2013-07-18 15:12     ` Peter Maydell
2013-07-18 15:35   ` Paolo Bonzini
2013-07-18 16:31     ` Frederic Konrad
2013-07-18 16:35       ` Paolo Bonzini
2013-07-19 15:26         ` Frederic Konrad
2013-07-29 15:27     ` Frederic Konrad
2013-07-29 16:42       ` Paolo Bonzini
2013-07-30  7:06         ` Frederic Konrad

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).