From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KWIhZ-0003kv-9l for qemu-devel@nongnu.org; Thu, 21 Aug 2008 18:32:21 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KWIhX-0003kj-0S for qemu-devel@nongnu.org; Thu, 21 Aug 2008 18:32:20 -0400 Received: from [199.232.76.173] (port=38642 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KWIhW-0003kg-Te for qemu-devel@nongnu.org; Thu, 21 Aug 2008 18:32:18 -0400 Received: from hall.aurel32.net ([91.121.138.14]:41762) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KWIhV-00082J-TE for qemu-devel@nongnu.org; Thu, 21 Aug 2008 18:32:18 -0400 Date: Fri, 22 Aug 2008 00:32:05 +0200 From: Aurelien Jarno Subject: Re: [Qemu-devel] [5050] uhci: rewrite UHCI emulator, fully async operation with multiple outstanding transactions ( Max Krasnyansky) Message-ID: <20080821223205.GA15756@volta.aurel32.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Krasnyansky Cc: Anthony Liguori , qemu-devel@nongnu.org On Thu, Aug 21, 2008 at 07:30:32PM +0000, Anthony Liguori wrote: > Revision: 5050 > http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5050 > Author: aliguori > Date: 2008-08-21 19:30:31 +0000 (Thu, 21 Aug 2008) > > Log Message: > ----------- > uhci: rewrite UHCI emulator, fully async operation with multiple outstanding transactions (Max Krasnyansky) Please note that this commit has broken the -usbdevice option (at least disk, tablet and mouse) for a GNU/Linux guest running a 2.6.18 kernel. > This is esentially a re-write of the QEMU UHCI layer. My initial goal > was to support fully async operation with multiple outstanding async > transactions. Along the way I realized that I can greatly simplify > and cleanup the overall logic. There was a lot of duplicate and confusing > code in the UHCI data structure parsing and other places. > We were actually violating UHCI spec in handling async ISOC transaction > (host controller is not supposed to write into the frame pointer). > > The reason I wanted to support fully async operation is because current > synchronous version is unusable with most devices exported from host > (via usb-linux.c). Transactions take a long time and the whole VM becomes > slow as hell. > > Current async support is very rudimentory and for the most part > non-functional. Single transaction at a time is simply not enough. I have > a device for which XP driver submits both IN and OUT packets at the same > time. IN packet always times out unless OUT packet makes it to the device. > Hence we must be able to process both in order for that device to work. > > The new code is backwards compatible and was first tested agains original > synchronous usb-linux.c and builtin usb devices like tablet which is also > synchronous. Rewrite of the usb-linux.c is coming up next. > > Async support was tested against various XP versions (ie XP, SP2, SP3) and > a bunch of different USB devices: serial port controllers, mice, keyboard, > JTAG dongles (from Xilinx and Altera). > > ISOC support was only lighly tested and needs more work. It's not any worse > than current code though. > > UHCI parser changes are probably somewhat hard to review without the > understanding of the UHCI spec. > The async design should be fairly easy to follow. Basically we have a list > of async objects for each pending transfer. Async objects are tagged with > the original TD (transfer descriptor) address and token. We now support > unlimited number of outstanding isoc and one outstanding bulk/intr/ctrl > transfer per QH (queue head). UHCI spec does not have a clear protocol for > the cancelation of the trasfer requests. Driver can yank out TDs on any > frame boundary. In oder to handle that I added somewhat fancy TD validation > logic logic to avoid unnecessary cancelations. > > Signed-off-by: Max Krasnyansky > Signed-off-by: Anthony Liguori > -- .''`. Aurelien Jarno | GPG: 1024D/F1BCDB73 : :' : Debian developer | Electrical Engineer `. `' aurel32@debian.org | aurelien@aurel32.net `- people.debian.org/~aurel32 | www.aurel32.net