|Subject:||Re: [Qemu-devel] [RFC] reverse execution.|
|Date:||Sun, 19 May 2013 16:47:02 -0500|
Argh, reply all is needed.
We had to do something similar for our (soon to be released) record and replay implementation. To ensure interrupts are delivered at precisely the right time we added a global 64 bit instruction counter and then modified translate.c for each architecture to emit tcg ops that increment it before each instruction. At the end of translating a TB we store the number of instructions in that TB.
Then during replay, before every basic block executes (we disabled chaining) we check whether the current instruction count plus the number of instructions in the next TB is greater than the instruction count recorded for the next interrupt. If so, we retranslate and terminate the block at the right point so we can deliver the interrupt.
There is one gotcha to this, which is that care had to be taken to not interfere with the search_pc mechanism.
If the above explanation isn't clear feel free to ask questions or just wait 2 weeks and read the code. I'm not sure how much work it would be to integrate what we have into the gdb stub but I'd be delighted if someone took on the task.
|[Prev in Thread]||Current Thread||[Next in Thread]|