qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "andrzej zaborowski" <balrog@zabor.org>
To: qemu-devel@nongnu.org
Cc: eady <eady@wisc.edu>
Subject: Re: [Qemu-devel] Saving and restoring CPU state
Date: Thu, 19 Apr 2007 00:12:12 +0200	[thread overview]
Message-ID: <fb249edb0704181512x2411301ia52a3bb3ed85e3da@mail.gmail.com> (raw)
In-Reply-To: <200704181711.36981.rob@landley.net>

On 18/04/07, Rob Landley <rob@landley.net> wrote:
> On Thursday 12 April 2007 12:16 pm, eady wrote:
> > I'm still looking for any suggestions on how to save and restore the
> > target cpu state from within a custom instruction in op.c. I basically
> > want a custom instruction to save the cpu state to a data structure and
> > then continue on normally, a second custom instruction would then be
> > used to restore the cpu state from the saved data structure at a later
> > time thereby rolling back the execution of the cpu. I've tried saving
> > and restoring env->eip within my custom instructions but this has no effect.
>
> How do you roll back all the writes to memory and interactions with devices
> the processor may have done?
>
> Saving and restoring _just_ the processor state is what setjmp/longjmp does,
> and there's all sorts of restrictions on its' use...

Saving and restoring just (part of) the processor state kindof is done
by i386 instructions like syscall/sysret, sysenter/sysexit, SMM/RSM
stuff and other instructions. Have a look at target-i386/helper.c

HTH,
Andrzej

  reply	other threads:[~2007-04-18 22:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-12 16:16 [Qemu-devel] Saving and restoring CPU state eady
2007-04-18 21:11 ` Rob Landley
2007-04-18 22:12   ` andrzej zaborowski [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-04-08 21:38 eady

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=fb249edb0704181512x2411301ia52a3bb3ed85e3da@mail.gmail.com \
    --to=balrog@zabor.org \
    --cc=balrogg@gmail.com \
    --cc=eady@wisc.edu \
    --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 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).