]> git.karo-electronics.de Git - karo-tx-linux.git/commit
kvm: Dump state on SIGQUIT
authorPekka Enberg <penberg@cs.helsinki.fi>
Sat, 24 Apr 2010 06:54:52 +0000 (09:54 +0300)
committerPekka Enberg <penberg@cs.helsinki.fi>
Sat, 24 Apr 2010 06:54:52 +0000 (09:54 +0300)
commit5f0c31b02db4ee488f7b3788f67b18a21a5c25a3
treef7f84603d610aeaa977a7263e58cfb3e8d15a894
parent9e3678c709ce4414341858bb25687d21c6bdae02
kvm: Dump state on SIGQUIT

This patch adds state dumping to SIGQUIT signal handler to make debugging
infinite loops easier.  If a kernel gets stuck under KVM, you can press Ctrl-4
and then use 'addr2line' to figure out the exact location where it's stuck from
the reported 'rip':

  ^\[    0.000000] Calibrating delay loop... Registers:
   rip: ffffffff816a0c83   rsp: ffffffff81c01eb8 flags: 0000000000000246
   rax: 00000000ffff8ad0   rbx: ffffffff81d541a0   rcx: 00000000ffffffff
   rdx: 00000000ffff8ad0   rsi: 0000000000000046   rdi: 0000000000002000
   rbp: ffffffff81c01f28   r8:  00000000000003fd   r9:  0000000000000000
   r10: 0000000000000000   r11: 000000000000000d   r12: ffffffff81d56d20
   r13: 0000000000000000   r14: ffffffffffffffff   r15: 0000000000013690
   cr0: 000000008005003b   cr2: 0000000000000000   cr3: 0000000001c08000
   cr4: 00000000000006b0   cr8: 0000000000000000
  Segment registers:
   register  selector  base              limit     type  p dpl db s l g avl
   cs        0010      0000000000000000  ffffffff  0b    1 0   0  1 1 1 0
   ss        0000      0000000000000000  ffffffff  00    0 0   0  0 0 0 0
   ds        0000      0000000000000000  ffffffff  00    0 0   0  0 0 0 0
   es        0000      0000000000000000  ffffffff  00    0 0   0  0 0 0 0
   fs        0000      0000000000000000  ffffffff  00    0 0   0  0 0 0 0
   gs        0000      ffff880002000000  ffffffff  00    0 0   0  0 0 0 0
   tr        0040      ffff880002011bc0  00002087  0b    1 0   0  0 0 0 0
   ldt       0000      0000000000000000  ffffffff  00    0 0   0  0 0 0 0
   gdt                 ffff880002004000  0000007f
   idt                 ffffffff81de9000  00000fff
   [ efer: 0000000000000d01  apic base: 0000000000000000  nmi: enabled ]
  Interrupt bitmap:
   0000000000000000 0000000000000000 0000000000000000 0000000000000000
  Code:
  Stack:
  penberg@tiger:~/vm$ addr2line -e vmlinux
  0xffffffff816a0c83
  /home/penberg/linux/init/calibrate.c:149

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
tools/kvm/main.c