qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Saving and restoring CPU state


From: andrzej zaborowski
Subject: Re: [Qemu-devel] Saving and restoring CPU state
Date: Thu, 19 Apr 2007 00:12:12 +0200

On 18/04/07, Rob Landley <address@hidden> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]