From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KTiv9-0006su-JD for qemu-devel@nongnu.org; Thu, 14 Aug 2008 15:55:43 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KTiv9-0006s7-78 for qemu-devel@nongnu.org; Thu, 14 Aug 2008 15:55:43 -0400 Received: from [199.232.76.173] (port=43095 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KTiv8-0006rq-RV for qemu-devel@nongnu.org; Thu, 14 Aug 2008 15:55:42 -0400 Received: from hera.kernel.org ([140.211.167.34]:59472) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KTiv8-0006iM-Gn for qemu-devel@nongnu.org; Thu, 14 Aug 2008 15:55:42 -0400 Message-ID: <48A48DB2.9010800@kernel.org> Date: Thu, 14 Aug 2008 12:55:30 -0700 From: Max Krasnyansky MIME-Version: 1.0 References: <48A471AA.2010001@codemonkey.ws> In-Reply-To: <48A471AA.2010001@codemonkey.ws> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 0/5] Various USB fixes and improvements Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org Anthony Liguori wrote: > Max Krasnyansky wrote: >> 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. >> > > Altogether this patch series looks very promising. The current USB pass > through code is pretty fickle so some clean-up is definitely needed. Great. > I don't understand USB well enough to do a thorough review. I hope > others can look through it and provide more detailed feedback. That would be great. I bet not a lot of people understand UHCI specs though. > I'll do some testing of it tonight. Awesome. If something does not work as expected please enable DEBUG in both hw/usb-uhci.c and usb-linux.c and send me the output. Max