jclulow/illumos-kvm — Issue #5: Lockup during exit
Author: grevian
Created: 2012-01-28 21:13:04+00:00
State: open

I decided to take another crack at running this, I did a git pull, recompile & reinstall of this repos and illumos-kvm-cmd, then I started a host as

```
$ /smartdc/bin/qemu-system-x86_64 \
-enable-kvm \
-nographic \
-drive file=/export/media/OS/WindowsXP.iso,media=cdrom,if=ide \
-boot order=cd \
-smp 2 \
-m 256 \
-vnc 0.0.0.0:0 \
-chardev socket,id=serial0,path=/tmp/vm.console,server,nowait \
-serial chardev:serial0 \
-drive file=/dev/zvol/rdsk/tank/wxp,if=virtio,index=0
```

I then attempted to connect over an SSH tunnel to VNC, but was not successful (VNC simply hung, then disconnected when I closed the tunnel), I then attempted to kill the host, first with ctrl-c, then ctrl-z, then from another terminal I tried kill, then kill -9, none appeared successful. After this however the process showed in top as using 0% CPU (Though Kernel CPU usage is pegged at 50%), but in ps it showed as using 50% CPU (ie, an entire core of my dual core machine), Below is the output of several commands as requested by richlowe, starting with a truncated copy & paste from top

This is on a Gigabyte GA-MA78LM-S2H Motherboard (http://ca.gigabyte.com/products/product-page.aspx?pid=3373) with an AMD Athlon(tm) 64 X2 Dual Core Processor 5200+ CPU

-------------------------------------------------------------------------------------

last pid: 7500; load avg: 0.01, 0.01, 0.00; up 63+01:23:45 01:14:01
57 processes: 54 sleeping, 1 running, 2 on cpu
CPU states: 49.8% idle, 0.0% user, 50.2% kernel, 0.0% iowait, 0.0% swap
Kernel: 238 ctxsw, 13 trap, 454 intr, 90 syscall, 12 flt
Memory: 1919M phys mem, 730M free mem, 959M total swap, 880M free swap

PID USERNAME NLWP PRI NICE SIZE RES STATE TIME CPU COMMAND
7125 root 2 0 0 293M 280M cpu/1 0:22 0.00% qemu-system-x86

-------------------------------------------------------------------------------------

root@tiphares:~# ps aux | grep qemu
root 7125 50.0 14.7299524286844 ? O 23:26:24 0:22 /smartdc/bin/qemu-

-------------------------------------------------------------------------------------

root@tiphares:~# pstack 7125
pstack: cannot examine 7125: no such process

-------------------------------------------------------------------------------------

root@tiphares:~# mdb -k
Loading modules: [ unix genunix specfs dtrace mac cpu.generic cpu_ms.AuthenticAMD.15 uppc pcplusmp scsi_vhci zfs ip hook neti sockfs arp usba stmf stmf_sbd fctl idm sata crypto random md cpc fcp fcip sd lofs ufs logindmux ptm sppp nsmb smbsrv nfs ipc ]
> ::pgrep qemu
S PID PPID PGID SID UID FLAGS ADDR NAME
R 7125 1 7124 7097 0 0x4a304102 ffffff0140dbb040 qemu-system-x86_
>

-------------------------------------------------------------------------------------
root@tiphares:~# mdb -k
Loading modules: [ unix genunix specfs dtrace mac cpu.generic cpu_ms.AuthenticAMD.15 uppc pcplusmp scsi_vhci zfs ip hook neti sockfs arp usba stmf stmf_sbd fctl idm sata crypto random md cpc fcp fcip sd lofs ufs logindmux ptm sppp nsmb smbsrv nfs ipc ]
> ::pgrep qemu
S PID PPID PGID SID UID FLAGS ADDR NAME
R 7125 1 7124 7097 0 0x4a304102 ffffff0140dbb040 qemu-system-x86_
> ::pgrep qemu | ::walk thread | ::findstack -v
stack pointer for thread ffffff013d3d7840: ffffff0004e43c50
[ ffffff0004e43c50 _resume_from_idle+0xf1() ]
ffffff0004e43c80 swtch+0x145()
ffffff0004e43cb0 cv_wait+0x61(ffffff0140dbb106, ffffff01380cfdc0)
ffffff0004e43cf0 exitlwps+0x1cb(0)
ffffff0004e43d80 proc_exit+0x55(2, 9)
ffffff0004e43da0 exit+0x15(2, 9)
ffffff0004e43e20 psig+0x582()
ffffff0004e43f00 post_syscall+0x49e(4, 12b2292a0)
ffffff0004e43f10 0xfffffffffb800c91()
stack pointer for thread ffffff013a10b080: ffffff00041f0f80
[ ffffff00041f0f80 _resume_from_idle+0xf1() ]
ffffff00041f10c0 rmap_add+0xe5(ffffff0155393000, fffffe001ac54270, fffd)
ffffff00041f1170 mmu_set_spte+0x198(ffffff0155393000, fffffe001ac54270, 3, 3, 0, 0, 40, ffffff00041f129c, ffffff0000000001, fffd, 63c0f, 0, 1)
ffffff00041f1270 paging32_fetch+0x117(ffffff0155393000, fa04ebd4, ffffff00041f12a0, 0, 0, 1, ffffff00041f129c, 63c0f)
ffffff00041f1340 paging32_page_fault+0x1b4(ffffff0155393000, fa04ebd4, 0)
ffffff00041f1390 kvm_mmu_page_fault+0x2f(ffffff0155393000, fa04ebd4, 0)
ffffff00041f13d0 pf_interception+0x66(ffffff0155393000)
ffffff00041f1410 handle_exit+0x14b(ffffff0155393000)
ffffff00041f1440 vcpu_enter_guest+0x3a5(ffffff0155393000)
ffffff00041f1470 __vcpu_run+0x84(ffffff0155393000)
ffffff00041f14c0 kvm_arch_vcpu_ioctl_run+0x114(ffffff0155393000)
ffffff00041f1d00 kvm_ioctl+0x134(10d00000002, 2000ae80, 0, 202003, ffffff0140b7cd18, ffffff00041f1e24)
ffffff00041f1d40 cdev_ioctl+0x45(10d00000002, 2000ae80, 0, 202003, ffffff0140b7cd18, ffffff00041f1e24)
ffffff00041f1d80 spec_ioctl+0x5a(ffffff0156670480, 2000ae80, 0, 202003, ffffff0140b7cd18, ffffff00041f1e24, 0)
ffffff00041f1e00 fop_ioctl+0x7b(ffffff0156670480, 2000ae80, 0, 202003, ffffff0140b7cd18, ffffff00041f1e24, 0)
ffffff00041f1f00 ioctl+0x18e(a, 2000ae80, 0)
ffffff00041f1f10 sys_syscall+0x17a()
>

-------------------------------------------------------------------------------------

root@tiphares:~# uname -a
SunOS tiphares 5.11 oi_151a i86pc i386 i86pc Solaris

root@tiphares:~# isainfo -v
64-bit amd64 applications
amd_svm tscp ahf cx16 sse3 sse2 sse fxsr amd_3dnowx amd_3dnow amd_mmx
mmx cmov amd_sysc cx8 tsc fpu
32-bit i386 applications
amd_svm tscp ahf cx16 sse3 sse2 sse fxsr amd_3dnowx amd_3dnow amd_mmx
mmx cmov amd_sysc cx8 tsc fpu

-------------------------------------------------------------------------------------