Skip to contentSkip to conversation

How to capture guest %rip from a qemu process without monitor?

Qemu-devel Richard W.M. Jones 2 participants 3 messages Sep 30, 2011

lore
Share & tools
lore
#0 lore raw

I've finally managed to reproduce a very infrequent kernel boot hang by forcing TCG (so it runs slower, bug seems to be timing sensitive) and running a boot test in a loop thousands of times.

I'd like to find out where in the guest kernel this is looping.

Unfortunately I don't have access to the monitor so "info registers" won't work, but I can attach to the qemu process with gdb.

Which TCG struct contains %rip, other registers? What other useful information can be captured using only gdb?

Rich.

https://bugzilla.redhat.com/show_bug.cgi?id=723822

Command line:

qemu-kvm -machine pc,accel=tcg -drive file=/dev/null,if=virtio
-nodefconfig -nodefaults -nographic -m 500 -no-reboot -no-hpet -device virtio-serial -serial stdio -chardev socket,path=/home/rjones/d/libguestfs/libguestfsoFRvo0/guestfsd.sock,id=channel0 -device virtserialport,chardev=channel0,name=org.libguestfs.channel.0 -kernel /home/rjones/d/libguestfs/.guestfs-500/kernel.27140 -initrd /home/rjones/d/libguestfs/.guestfs-500/initrd.27140 -append 'panic=1 console=ttyS0 udevtimeout=300 no_timer_check acpi=off printk.time=1 cgroup_disable=memory selinux=0 guestfs_verbose=1 TERM=xterm' -drive file=/home/rjones/d/libguestfs/.guestfs-500/root.27140,snapshot=on,if=virtio,cache=unsafe

Signature · 4 lines
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
New in Fedora 11: Fedora Windows cross-compiler. Compile Windows
programs, test, and build Windows installers. Over 70 libraries supprt'd
http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw
#1 lore raw
Quoted 5 lines · Richard W.M. Jones

I've finally managed to reproduce a very infrequent kernel boot hang by forcing TCG (so it runs slower, bug seems to be timing sensitive) and running a boot test in a loop thousands of times.

Quoted 7 lines

I'd like to find out where in the guest kernel this is looping.

Unfortunately I don't have access to the monitor so "info registers" won't work, but I can attach to the qemu process with gdb.

Which TCG struct contains %rip, other registers? What other useful information can be captured using only gdb?

Print first_cpu->eip, maybe also first_cpu->segs[1] to dump the CS segment cache (relevant while in real mode).

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
#2 lore raw
Quoted 8 lines · Jan Kiszka
Quoted 7 lines · Richard W.M. Jones

I've finally managed to reproduce a very infrequent kernel boot hang by forcing TCG (so it runs slower, bug seems to be timing sensitive) and running a boot test in a loop thousands of times.

I'd like to find out where in the guest kernel this is looping.

Quoted 8 lines
Quoted 5 lines

Unfortunately I don't have access to the monitor so "info registers" won't work, but I can attach to the qemu process with gdb.

Which TCG struct contains %rip, other registers? What other useful information can be captured using only gdb?

Print first_cpu->eip, maybe also first_cpu->segs[1] to dump the CS segment cache (relevant while in real mode).

Perfect thanks!

*first_cpu contains a wealth of info.

Rich.

Signature · 4 lines
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
New in Fedora 11: Fedora Windows cross-compiler. Compile Windows
programs, test, and build Windows installers. Over 70 libraries supprt'd
http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw