* [Qemu-devel] Saving and restoring CPU state
@ 2007-04-08 21:38 eady
0 siblings, 0 replies; 4+ messages in thread
From: eady @ 2007-04-08 21:38 UTC (permalink / raw)
To: qemu-devel
I'm experimenting a bit with QEMU and am in need of a way to save and
restore X86 CPU state including the pc so that the processor state can
be rolled back to re execute from the previous point. I've found the
functions "cpu_x86_fsave" and "cpu_restore_state" but do not understand
them well enough to use them. Does anyone have tips on how to store the
processor state in an auxiliary data structure and then restore it at a
later point?
Thanks
Nuri
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Qemu-devel] Saving and restoring CPU state
@ 2007-04-12 16:16 eady
2007-04-18 21:11 ` Rob Landley
0 siblings, 1 reply; 4+ messages in thread
From: eady @ 2007-04-12 16:16 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 519 bytes --]
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.
Thanks,
Nuri
[-- Attachment #2: [Qemu-devel] Saving and restoring CPU state --]
[-- Type: message/rfc822, Size: 4385 bytes --]
From: eady <eady@wisc.edu>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] Saving and restoring CPU state
Date: Sun, 08 Apr 2007 16:38:14 -0500
Message-ID: <461960C6.8010904@wisc.edu>
I'm experimenting a bit with QEMU and am in need of a way to save and
restore X86 CPU state including the pc so that the processor state can
be rolled back to re execute from the previous point. I've found the
functions "cpu_x86_fsave" and "cpu_restore_state" but do not understand
them well enough to use them. Does anyone have tips on how to store the
processor state in an auxiliary data structure and then restore it at a
later point?
Thanks
Nuri
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] Saving and restoring CPU state
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
0 siblings, 1 reply; 4+ messages in thread
From: Rob Landley @ 2007-04-18 21:11 UTC (permalink / raw)
To: qemu-devel; +Cc: eady
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...
Rob
--
Penguicon 5.0 Apr 20-22, Linux Expo/SF Convention. Bruce Schneier, Christine
Peterson, Steve Jackson, Randy Milholland, Elizabeth Bear, Charlie Stross...
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] Saving and restoring CPU state
2007-04-18 21:11 ` Rob Landley
@ 2007-04-18 22:12 ` andrzej zaborowski
0 siblings, 0 replies; 4+ messages in thread
From: andrzej zaborowski @ 2007-04-18 22:12 UTC (permalink / raw)
To: qemu-devel; +Cc: eady
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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-04-18 22:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
-- strict thread matches above, loose matches on Subject: below --
2007-04-08 21:38 eady
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).