qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] USB problem in QEMU
@ 2007-04-05  7:23 Yu, Xiaoyang
  2007-04-09  9:46 ` [Qemu-devel] " Raúl Sánchez Siles
  0 siblings, 1 reply; 7+ messages in thread
From: Yu, Xiaoyang @ 2007-04-05  7:23 UTC (permalink / raw)
  To: qemu-devel


[-- Attachment #1.1: Type: text/plain, Size: 4169 bytes --]

Hi guys,

 

The USB problem I met is that using some kind of USB disks will cause
guest OS run extremely slow, while these disks can work properly in host
OS. It looks like the USB simulation in QEMU is not fully featured, and
can not handle some error conditions properly.

 

Below are the /proc/bus/usb/devices information in the host OS for four
type of USB disks. The first two disks can work properly in guest OS;
while the last two disks will cause the gust OS extremely slow (like not
responding).

 

The /proc/bus/usb/devices information in host OS for USB disks which
works properly in guest OS:

========================================================================
=======================

T:  Bus=03 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  2 Spd=12  MxCh= 0

D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1

P:  Vendor=1043 ProdID=8006 Rev= 1.00

S:  Manufacturer=Generic

S:  Product=Flash Disk

C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA

I:  If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50
Driver=usb-storage

E:  Ad=81(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms

E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms

 

T:  Bus=01 Lev=01 Prnt=01 Port=03 Cnt=01 Dev#=  6 Spd=480 MxCh= 0

D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1

P:  Vendor=0930 ProdID=6533 Rev= 1.00

S:  Manufacturer=Kingston

S:  Product=DataTraveler 2.0

C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA

I:  If#= 0 Alt= 0 #EPs= 3 Cls=08(stor.) Sub=06 Prot=50
Driver=usb-storage

E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms

E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=31875us

E:  Ad=83(I) Atr=03(Int.) MxPS=   8 Ivl=64ms

 

 

The /proc/bus/usb/devices information in host OS for USB disks which
does not work properly in guest OS:

========================================================================
==============================================

T:  Bus=03 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  3 Spd=12  MxCh= 0

D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1

P:  Vendor=0ed1 ProdID=6680 Rev= 1.00

S:  Manufacturer=Generic

S:  Product=Mass Storage Device

C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr= 50mA

I:  If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50
Driver=usb-storage

E:  Ad=01(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms

E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms

 

T:  Bus=01 Lev=01 Prnt=01 Port=03 Cnt=01 Dev#=  4 Spd=480 MxCh= 0

D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1

P:  Vendor=0204 ProdID=6025 Rev= 1.00

S:  Manufacturer=USB0612

S:  Product=Flash Disk

S:  SerialNumber=335657409262

C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA

I:  If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50
Driver=usb-storage

E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=125us

E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms

 

To get more information, I turned on the DEBUG_PACKET macro in
xen/tools/ioemu/hw/usb-uhci.c to get QEMU log messages. The logs contain
the UHCI packets. You may kindly find the log files in the attachment.
"log.good" is the log file for inserting a "good" disk which works
properly in guest OS. "log.bad" is the log file for inserting a "bad"
disk which cause the guest OS not responding. 

 

We analyzed the log files. 

 

In line 149 of "log.bad", there is a "ret=-3", which means there was
error sending the SETUP packet to endpoint 0. There are also errors for
receiving IN packets from endpoint 0. 

 

In line 247 of "log.bad", there is a "handle_data: errno=32", which
means a "broken pipe" error. Then from line 255 of "log.bad", there are
lots of "ret=-2" error for receiving IN packets from endpoint 2. 

 

For compare, we used Device Monitoring Studio to log the URBs on Windows
XP host OS when inserting the "bad" USB disk. You may check it in the
attachment as "usb.htm". In record 000061 of "usb.htm", there is a
"Reset Pipe" URB message. 

 

Compare "log.bad" and "usb.htm", we guess maybe the QEMU do not send
"Reset Pipe" message upon a "broken pipe" error. 

 

Any instructions or comments will be much appreciated. 

 

Regards

Xiaoyang


[-- Attachment #1.2: Type: text/html, Size: 16903 bytes --]

[-- Attachment #2: log files.zip --]
[-- Type: application/x-zip-compressed, Size: 144358 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-04-24  2:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-05  7:23 [Qemu-devel] USB problem in QEMU Yu, Xiaoyang
2007-04-09  9:46 ` [Qemu-devel] " Raúl Sánchez Siles
2007-04-23  9:19   ` Raúl Sánchez Siles
2007-04-23 10:00     ` Yu, Xiaoyang
2007-04-23 10:54       ` [Qemu-devel] " Raúl Sánchez Siles
2007-04-24  2:26         ` Yu, Xiaoyang
2007-04-24  2:29           ` Yu, Xiaoyang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).