All of lore.kernel.org
 help / color / mirror / Atom feed
From: fred.konrad@greensocs.com
To: qemu-devel@nongnu.org
Cc: mark.burton@greensocs.com, fred.konrad@greensocs.com
Subject: [Qemu-devel] [RFC PATCH 00/12] Reverse execution.
Date: Fri, 21 Mar 2014 20:17:22 +0100	[thread overview]
Message-ID: <1395429454-24690-1-git-send-email-fred.konrad@greensocs.com> (raw)

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

Hi everybody,

Those are the two first patch-set we have been worked on for reverse execution.

The first series:
  icount: put icount variables into TimerState.
  migration: migrate icount fields.
  migration: make qemu_savevm_state public.
  icount: introduce icount timer.
  icount: check for icount clock deadline when cpu loop exits.
  icount: make icount extra computed on icount clock as well.
  timer: add cpu_icount_to_ns function.

are various preparation patches for reverse execution.

The last patches:
  introduce reverse execution mechanism.
  gdbstub: allow reverse execution in gdb stub.
  cpu-exec: trigger a debug request when rexec stops.
  cexe: synchronize icount on the next event.
  cexe: allow to enable reverse execution.

are reverse execution introduction.

They can be clone at: git://git.greensocs.com/qemu_cexe.git:cexe_2_3

The third series will be sent as soon as possible and have some issues with
QEMU's thread as it use fork.

This implementation of reverse execution works with instruction counting:

A new clock is implemented which is icount clock. It grows each time an
instruction is executed and is totally independant of host clock.

Snapshots are taken regularly (based on icount clock) with help of migration
code and written on the disk.

When user wants to use reverse-stepi:
 * Last snapshot is reloaded.
 * A stop callback is created to be triggered at the previous instruction.

This stop callback generates a debug exception so QEMU stops in debug mode.

Command line:
 * -cexe option is added to enable reverse execution, it needs icount 1.

About non determinism in QEMU:
 * This implementation doesn't take IO in account so any IO will cause non
   determinism and break reverse execution.

 * The icount warp mechanism have been disabled when reverse execution is
   enabled so the time grow differently inside the VM.

Testing:
 * It has been tested on ARM without any IO such as network or asynchronous file
   access to keep the deterministic behaviour of icount.

Known issues:
 * On ARM stepi seems to do some additional steps which are added to icount
   counter so reverse-stepi just after stepi is broken.

 * The IO replay explained above.

KONRAD Frederic (12):
  icount: put icount variables into TimerState.
  migration: migrate icount fields.
  migration: make qemu_savevm_state public.
  icount: introduce icount timer.
  icount: check for icount clock deadline when cpu loop exits.
  icount: make icount extra computed on icount clock as well.
  timer: add cpu_icount_to_ns function.
  introduce reverse execution mechanism.
  gdbstub: allow reverse execution in gdb stub.
  cpu-exec: trigger a debug request when rexec stops.
  cexe: synchronize icount on the next event.
  cexe: allow to enable reverse execution.

 Makefile.target             |   1 +
 cpu-exec.c                  |  13 ++
 cpus.c                      | 121 +++++++++++++---
 gdbstub.c                   |  31 ++++-
 include/qemu/timer.h        |  17 +++
 include/reverse-execution.h |  43 ++++++
 include/sysemu/sysemu.h     |   1 +
 main-loop.c                 |  10 ++
 qemu-options.hx             |   9 ++
 qemu-timer.c                |   6 +
 reverse-execution.c         | 326 ++++++++++++++++++++++++++++++++++++++++++++
 savevm.c                    |   2 +-
 stubs/Makefile.objs         |   1 +
 stubs/cexe-stub.c           |  32 +++++
 stubs/cpu-get-icount.c      |  13 ++
 vl.c                        |  23 +++-
 16 files changed, 627 insertions(+), 22 deletions(-)
 create mode 100644 include/reverse-execution.h
 create mode 100644 reverse-execution.c
 create mode 100644 stubs/cexe-stub.c

-- 
1.8.1.4

             reply	other threads:[~2014-03-21 19:18 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-21 19:17 fred.konrad [this message]
2014-03-21 19:17 ` [Qemu-devel] [RFC PATCH 01/12] icount: put icount variables into TimerState fred.konrad
2014-03-22  8:58   ` Paolo Bonzini
2014-03-21 19:17 ` [Qemu-devel] [RFC PATCH 02/12] migration: migrate icount fields fred.konrad
2014-03-22  8:57   ` Paolo Bonzini
2014-03-24 14:49     ` Frederic Konrad
2014-03-24 15:42       ` Paolo Bonzini
2014-03-25 10:25         ` Frederic Konrad
2014-03-21 19:17 ` [Qemu-devel] [RFC PATCH 03/12] migration: make qemu_savevm_state public fred.konrad
2014-03-21 19:54   ` Dr. David Alan Gilbert
2014-03-24 15:05     ` Frederic Konrad
2014-03-24 17:52       ` Dr. David Alan Gilbert
2014-03-21 19:17 ` [Qemu-devel] [RFC PATCH 04/12] icount: introduce icount timer fred.konrad
2014-03-22  8:59   ` Paolo Bonzini
2014-03-21 19:17 ` [Qemu-devel] [RFC PATCH 05/12] icount: check for icount clock deadline when cpu loop exits fred.konrad
2014-03-22  8:59   ` Paolo Bonzini
2014-03-21 19:17 ` [Qemu-devel] [RFC PATCH 06/12] icount: make icount extra computed on icount clock as well fred.konrad
2014-03-22  9:00   ` Paolo Bonzini
2014-03-21 19:17 ` [Qemu-devel] [RFC PATCH 07/12] timer: add cpu_icount_to_ns function fred.konrad
2014-03-22  9:00   ` Paolo Bonzini
2014-03-21 19:17 ` [Qemu-devel] [RFC PATCH 08/12] introduce reverse execution mechanism fred.konrad
2014-03-21 19:17 ` [Qemu-devel] [RFC PATCH 09/12] gdbstub: allow reverse execution in gdb stub fred.konrad
2014-03-21 19:17 ` [Qemu-devel] [RFC PATCH 10/12] cpu-exec: trigger a debug request when rexec stops fred.konrad
2014-03-21 19:17 ` [Qemu-devel] [RFC PATCH 11/12] cexe: synchronize icount on the next event fred.konrad
2014-03-21 19:17 ` [Qemu-devel] [RFC PATCH 12/12] cexe: allow to enable reverse execution fred.konrad

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1395429454-24690-1-git-send-email-fred.konrad@greensocs.com \
    --to=fred.konrad@greensocs.com \
    --cc=mark.burton@greensocs.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.