qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/5] Various USB fixes and improvements
@ 2008-08-14  4:22 Max Krasnyansky
  2008-08-14  4:22 ` [Qemu-devel] [PATCH 1/5] husb: support for USB host device auto disconnect Max Krasnyansky
                   ` (5 more replies)
  0 siblings, 6 replies; 37+ messages in thread
From: Max Krasnyansky @ 2008-08-14  4:22 UTC (permalink / raw)
  To: qemu-devel; +Cc: kvm, Max Krasnyansky

This patch series started when I tried to share USB ports between 
four instances of Windows XP running on the same Linux box (under KVM).
I quickly realized that current USB support is not very flexible. We do
not handle devices disconnects, there is not way to assign certain USB
ports to VM instance, etc.

Once I fixed that I discovered that USB devices that I absolutely need
in the VMs (Xilinx and Altera USB dongles) do not really work with
QEMU. VMs were getting stuck, applications unhappy, etc.
So I endded up rewriting UHCI and Linux host USB layers to make them 
fully async and to support multiple outstanding transactions.

The result is quite nice. We can now assign USB buses to VM instances 
and devices are automatically connected to the VMs. Just do 
    usb_add host:N.*
in the console or -usbdevice command line option (N is the bus number).
Also when device is disconnected from the host it's automatically removed
from the guest.

Host USB devices operate in fully async mode (except the control transfers).
All the stalls and jerkiness due to long synchronous transactions is gone.
I can easily hook up four different USB devices (mouse, CF card reader, 
phone, Xilinx dongle) and everything is working perfectly. Mouse movements
are silky smooth :).

I did some profiling with OProfile and we seems to be doing ok while XP is 
pumping ~10 MBytes over USB (reported by one of the apps I'm using). UHCI 
stuff is well below VNC for example.

There is more work to be done (async control transfers for example). But I 
think this is way better than what we have now and is ready for more testing
by wider audience. 

Most of the testing so far was done with KVM flavor of QEMU. I did test 
generic i386-softmmu target a bit, it's too slow for any serious testing 
with XP. I did full compile (all targets) too and it went fine.

Max Krasnyansky (5):
  husb: support for USB host device auto disconnect.
  husb: support for USB host device auto connect.
  usb:  generic packet handler cleanup and documentation
  uhci: rewrite UHCI emulator, fully async operation with multiple
        outstanding transactions
  husb: rewrite Linux host USB layer, fully async operation

 hw/usb-uhci.c |  897 ++++++++++++++++++++++++++++++++++-----------------------
 hw/usb.c      |  265 ++++++++++--------
 hw/usb.h      |   37 +++-
 usb-linux.c   |  675 +++++++++++++++++++++++++------------------
 vl.c          |   83 +++---
 5 files changed, 1160 insertions(+), 797 deletions(-)

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

end of thread, other threads:[~2008-10-16 21:27 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-14  4:22 [Qemu-devel] [PATCH 0/5] Various USB fixes and improvements Max Krasnyansky
2008-08-14  4:22 ` [Qemu-devel] [PATCH 1/5] husb: support for USB host device auto disconnect Max Krasnyansky
2008-08-14 16:28   ` [Qemu-devel] " Anthony Liguori
2008-08-14 19:26     ` Max Krasnyansky
2008-08-14 21:41     ` Max Krasnyansky
2008-08-14  4:22 ` [Qemu-devel] [PATCH 2/5] husb: support for USB host device auto connect Max Krasnyansky
2008-08-14 16:41   ` [Qemu-devel] " Anthony Liguori
2008-08-14 19:38     ` Max Krasnyansky
2008-08-14 20:21       ` Anthony Liguori
2008-08-14 20:34         ` Max Krasnyansky
2008-08-14 20:41           ` Anthony Liguori
2008-08-14 21:14             ` François Revol
2008-08-15  7:46             ` Guido Günther
2008-08-15 18:24               ` Max Krasnyansky
2008-08-15 18:31                 ` Javier Guerra
2008-08-18 18:21                   ` Max Krasnyansky
2008-08-18 18:52                     ` Javier Guerra
2008-08-18 18:56                       ` Jamie Lokier
2008-08-17  7:52                 ` Avi Kivity
2008-08-18 18:46                   ` Max Krasnyansky
2008-08-18 14:11                 ` Anthony Liguori
2008-08-18 18:16                   ` Max Krasnyansky
2008-08-14  4:22 ` [Qemu-devel] [PATCH 3/5] usb: generic packet handler cleanup and documentation Max Krasnyansky
2008-08-14  4:22 ` [Qemu-devel] [PATCH 4/5] uhci: rewrite UHCI emulator, fully async operation with multiple outstanding transactions Max Krasnyansky
2008-08-14 17:51   ` [Qemu-devel] " Anthony Liguori
2008-08-14 19:49     ` Max Krasnyansky
2008-10-11 23:54   ` [Qemu-devel] " Juergen Lock
2008-10-15 19:54     ` Max Krasnyansky
2008-10-15 22:05       ` andrzej zaborowski
2008-10-16 21:25         ` Juergen Lock
2008-08-14  4:22 ` [Qemu-devel] [PATCH 5/5] husb: rewrite Linux host USB layer, fully async operation Max Krasnyansky
2008-08-15 14:24   ` Paul Brook
2008-08-15 19:04     ` Max Krasnyansky
2008-08-15 19:53       ` Paul Brook
2008-08-18 18:40         ` Max Krasnyansky
2008-08-14 17:55 ` [Qemu-devel] Re: [PATCH 0/5] Various USB fixes and improvements Anthony Liguori
2008-08-14 19:55   ` Max Krasnyansky

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).