qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC] reverse execution.


From: Blue Swirl
Subject: Re: [Qemu-devel] [RFC] reverse execution.
Date: Thu, 9 May 2013 17:54:12 +0000

On Tue, May 7, 2013 at 6:27 PM, KONRAD Frédéric
<address@hidden> wrote:
> Hi,
>
> We are trying to find a way to do reverse execution happen with QEMU.
>
> Actually, it is possible to debug the guest through the gdbstub, we want to
> make the reverse execution possible with GDB as well.
>
> How we are trying to make that working (basically without optimisation):
>
> -QEMU takes regular snapshot of the VM:
>    that can be done with the save vm code without optimisation first.
>
> -When the VM is stopped and GDB requests a reverse-step:
>    load the last snapshot and replay to one instruction before the current
> PC.
>
> There are one issue with that for now (for a basic running reverse
> execution):
>     -How to stop one instruction before the actual PC.

Add a special translation mode for reverse execution where the next PC
is checked after each instruction. Alternatively, you could make
temporary snapshots during this mode (first 1s intervals, then 0.1s
etc) which could be used to find the location. I think this way was
discussed briefly earlier in the list, please check the archives.

>
> We though that using "-icount" and stop the guest a little time before the
> actual position would give us the right behavior (We use a qemu_timer with
> vm_clock to stop the vm at the good time), but it seems that it is not
> deterministic, and not reproducable.
>
> Is that normal?
>
> We don't make any input during the replay, and we though that it can be
> caused
> by some timer interruption but "-icount" is using a virtual timer as I
> understand?
>
> We have two other ideas:
>
>     -Using TCI and count each instruction executed by the processor, then
> stop
>         one instruction before the actual position. This seems slower.
>
>     -Using single-step to count each instruction, then stop one instruction
>         before the actual position.
>
> Would that be better?
>
> For now we can restore the VM from the last snapshot, when we do a
> reverse-step
> but we can't stop at the exact position.
>
> Thanks,
> Fred
>



reply via email to

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