Bug 752049

Summary: windows guest hangs when booting with usb stick passthrough
Product: Red Hat Enterprise Linux 6 Reporter: Xiaomei Gao <xigao>
Component: qemu-kvmAssignee: Gerd Hoffmann <kraxel>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.2CC: acathrow, areis, bsarathy, juzhang, michen, minovotn, mkenneth, qzhou, tburke, virt-maint, wdai
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: qemu-kvm-0.12.1.2-2.236.el6 Doc Type: Bug Fix
Doc Text:
Cause: EHCI controller reset handler was incorrect. Consequence: Windows guest hang on loading USB controller when booting with USB stick pass-through Fix: Fix reset handler implementation. Result: Windows guest with USB stick pass-through can boot up successfully
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-20 11:35:56 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Xiaomei Gao 2011-11-08 12:34:14 UTC
Version-Release number of selected component (if applicable):
--------------------------------------------------------------
host:
#uname -r
2.6.32-216.el6.x86_64
#rpm -qa | grep qemu-kvm
qemu-kvm-0.12.1.2-2.209.el6.x86_64

guest:
windows2008r2


How reproducible:
------------------
100%


Steps to Reproduce:
--------------------
boot guest:
/usr/libexec/qemu-kvm -monitor stdio -cpu qemu64,+sse2 -smp 2,cores=1,threads=4,sockets=2 -m 2G -drive file=/home/win2008r2-64-virtio.qcow2,if=none,id=drive-virtio-disk1,media=disk,cache=none,format=qcow2,werror=stop,bootindex=0 -device virtio-blk-pci,bus=pci.0,addr=0x3,drive=drive-virtio-disk1,id=virtio-disk1 -boot menu=on -M rhel6.2.0 -balloon none -spice port=8000,disable-ticketing -vga qxl -netdev tap,id=id10,script=/etc/qemu-ifup -device virtio-net-pci,netdev=id10,mac=9a:fe:9d:9b:24:10,id=ndev10,bus=pci.0,addr=0x5 -device usb-ehci,id=ehci -device usb-host,hostbus=2,hostaddr=2,id=hostdev1,bus=ehci.0,port=1


Actual results:
------------------
guest hangs and message as follows:
ehci: ASYNC list address register set while async schedule
      is enabled and HC is enabled
ehci: PERIODIC list base register set while periodic schedule
      is enabled and HC is enabled
ehci: PERIODIC list base register set while periodic schedule
      is enabled and HC is enabled
ehci: ASYNC list address register set while async schedule
      is enabled and HC is enabled


Expected results:
------------------
Usb device passthroughed should work correctly.

Comment 3 juzhang 2011-11-09 01:04:47 UTC
FYI,I just hit this issue with windows guests.linux guests works well

Comment 4 Xiaomei Gao 2011-11-24 05:24:39 UTC
also, i boot a guest with 1.0 controller:
/usr/libexec/qemu-kvm -usb -device usb-host,hostbus=2,hostaddr=2,id=hostdev1

dmesg on host:
JBD2: I/O error detected when updating journal superblock for sdb1-8.
Aborting journal on device sdb1-8.
JBD2: I/O error detected when updating journal superblock for sdb1-8.
journal commit I/O error
EXT4-fs error (device sdb1): ext4_put_super: Couldn't clean up the journal
EXT4-fs (sdb1): Remounting filesystem read-only

Comment 5 Gerd Hoffmann 2012-02-14 16:58:16 UTC
Win7 guest works fine, on WinXP the issue reproduces.
Will look into it.

Comment 6 Gerd Hoffmann 2012-02-23 14:39:18 UTC
http://patchwork.ozlabs.org/patch/142611/

Comment 7 Gerd Hoffmann 2012-02-29 13:05:18 UTC
Patch posted.

Comment 11 daiwei 2012-03-07 13:17:25 UTC
Reproduced with qemu-kvm-0.12.1.2-2.209.el6.x86_64

1. boot a Windows guest with a passthrough usb stick

# modprobe usb_storage

/usr/libexec/qemu-kvm -M rhel6.2.0 -cpu cpu64-rhel6 -enable-kvm -m 2G -smp 2,sockets=1,cores=2,threads=1 -name win2003sp2 -uuid 125b7bc8-1b37-49e9-9a33-7e8917c34b88 -rtc base=localtime,driftfix=slew -device virtio-serial-pci,id=virtio-serial0,max_ports=16,bus=pci.0,addr=0x4 -drive file=/nfs/win7-sp1-x64.raw,if=none,id=scsi0,format=raw,cache=none,werror=stop,rerror=stop,aio=native -device virtio-blk-pci,drive=scsi0,id=scsi0,bus=pci.0,addr=0x5,bootindex=1 -netdev tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup-switch -device virtio-net-pci,netdev=hostnet0,id=net0,mac=00:1a:4a:42:1a:52,bus=pci.0,addr=0x3 -chardev socket,id=charchannel0,path=/nfs/qzhang-test,server,nowait -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.rhevm.vdsm -spice port=9000,disable-ticketing -vga qxl -global qxl-vga.vram_size=33554432 -usb -device usb-tablet,id=input0 -device virtio-balloon-pci,id=balloon0,addr=0x7  -boot c -monitor stdio -device usb-ehci,id=ehci -device usb-host,hostbus=2,hostaddr=3,id=hostdev1,bus=ehci.0,port=1


*** EHCI support is under development ***
husb: open device 2.3
husb: grabbed usb device 2.3
QEMU 0.12.1 monitor - type 'help' for more information
(qemu) husb: config #1 need 1
husb: 1 interfaces claimed for configuration 1
ehci: ASYNC list address register set while async schedule
      is enabled and HC is enabled
ehci: PERIODIC list base register set while periodic schedule
      is enabled and HC is enabled
ehci: PERIODIC list base register set while periodic schedule
      is enabled and HC is enabled
ehci: ASYNC list address register set while async schedule
      is enabled and HC is enabled
spice_server_add_interface: SPICE_INTERFACE_TABLET
husb: config #1 need 1
husb: 1 interfaces claimed for configuration 1


Verified with qemu-kvm-0.12.1.2-2.236.el6.x86_64

# modprobe usb_storage

/usr/libexec/qemu-kvm -M rhel6.2.0 -cpu cpu64-rhel6 -enable-kvm -m 2G -smp 2,sockets=1,cores=2,threads=1 -name win2003sp2 -uuid 125b7bc8-1b37-49e9-9a33-7e8917c34b88 -rtc base=localtime,driftfix=slew -device virtio-serial-pci,id=virtio-serial0,max_ports=16,bus=pci.0,addr=0x4 -drive file=/nfs/win7-sp1-x64.raw,if=none,id=scsi0,format=raw,cache=none,werror=stop,rerror=stop,aio=native -device virtio-blk-pci,drive=scsi0,id=scsi0,bus=pci.0,addr=0x5,bootindex=1 -netdev tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup-switch -device virtio-net-pci,netdev=hostnet0,id=net0,mac=00:1a:4a:42:1a:52,bus=pci.0,addr=0x3 -chardev socket,id=charchannel0,path=/nfs/qzhang-test,server,nowait -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.rhevm.vdsm -spice port=9000,disable-ticketing -vga qxl -global qxl-vga.vram_size=33554432 -usb -device usb-tablet,id=input0 -device virtio-balloon-pci,id=balloon0,addr=0x7  -boot c -monitor stdio -device usb-ehci,id=ehci -device usb-host,hostbus=2,hostaddr=8,id=hostdev1,bus=ehci.0,port=1

*** EHCI support is under development ***
husb: open device 2.8
husb: grabbed usb device 2.8
QEMU 0.12.1 monitor - type 'help' for more information
(qemu) husb: device 2:8 reset took 2.790284 seconds
husb: device 2:8 reset took 2.546888 seconds
spice_server_add_interface: SPICE_INTERFACE_TABLET
husb: config #1 need 1
husb: 1 interfaces claimed for configuration 1


Guest works normally and can open the passthrough usb stick in guest.
So,this bug is fixed.

Comment 13 Michal Novotny 2012-05-04 08:47:41 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause:
EHCI controller reset handler was incorrect.

Consequence:
Windows guest hang on loading USB controller when booting with USB stick pass-through

Fix:
Fix reset handler implementation.

Result:
Windows guest with USB stick pass-through can boot up successfully

Comment 14 errata-xmlrpc 2012-06-20 11:35:56 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-0746.html