From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HeHWQ-0006MY-BP for qemu-devel@nongnu.org; Wed, 18 Apr 2007 17:17:02 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HeHWO-0006MK-9p for qemu-devel@nongnu.org; Wed, 18 Apr 2007 17:17:00 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HeHWO-0006MH-40 for qemu-devel@nongnu.org; Wed, 18 Apr 2007 17:17:00 -0400 Received: from static-71-162-243-5.phlapa.fios.verizon.net ([71.162.243.5] helo=grelber.thyrsus.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HeHRU-0003wX-Oa for qemu-devel@nongnu.org; Wed, 18 Apr 2007 17:11:57 -0400 From: Rob Landley Subject: Re: [Qemu-devel] Saving and restoring CPU state Date: Wed, 18 Apr 2007 17:11:36 -0400 References: <461E5B63.8040906@wisc.edu> In-Reply-To: <461E5B63.8040906@wisc.edu> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200704181711.36981.rob@landley.net> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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...