As replay works well, the reverse debugging should be ok too.
But for "going back" it needs a VM snapshot that can be used for reload.

Snapshots are saved on qcow2 images connected to QEMU.
Therefore you need to add an empty qcow2 to your command line with the following option: -drive file=empty.qcow2,if=none,id=rr

And you also need to add rrsnapshot to icount for creating the snapshot at the start of VM execution:
-icount shift=auto,rr=record,rrfile=$REPLAY_FILE,rrsnapshot=start


On 18.01.2023 09:14, Hyeonggon Yoo wrote:
Hello QEMU folks.
I was struggling to fix a recent heisenbug in the Linux kernel,
and fortunately the bug was reproducible with TCG and -smp 1.

I'm using qemu version 7.2.0, and guest architecture is i386.
I tried to inspect the bug using record/replay and reverse-debugging
feature in the QEMU.


recorded with:

qemu-system-i386 \
         -icount shift=auto,rr=record,rrfile=$REPLAY_FILE \
         -kernel arch/x86/boot/bzImage \
         -cpu SandyBridge \
         -initrd debian-i386.cgz \
         -smp 1 \
         -m 1024 \
         -nographic \
         -net none \
         -append "page_owner=on console=ttyS0"

and replayed with:

qemu-system-i386 \
         -icount shift=auto,rr=replay,rrfile=$REPLAY_FILE \
         -kernel arch/x86/boot/bzImage \
         -cpu SandyBridge \
         -initrd debian-i386.cgz \
         -smp 1 \
         -m 1024 \
         -nographic \
         -net none \
         -s \
         -append "page_owner=on console=ttyS0"

(I'm using a initrd image instead of a disk file.)

The record and replay works well. The bug is reliably reproduced
when relaying. but when I try to reverse-continue or reverse-stepi after
kernel panic, the gdb only says:

        "remote failure reply 'E14'"

Is there something I'm missing, or record/replay do not work with
QEMU v7.2.0 or i386?

--
Best regards,
Hyeonggon


Reply via email to