From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:50705) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9YG9-0001nE-TG for qemu-devel@nongnu.org; Thu, 06 Sep 2012 05:20:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T9YG3-0007ym-S4 for qemu-devel@nongnu.org; Thu, 06 Sep 2012 05:20:25 -0400 Received: from vps146.softec-internet.com ([188.95.114.51]:49691) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9YG3-0007uz-L7 for qemu-devel@nongnu.org; Thu, 06 Sep 2012 05:20:19 -0400 Received: from vps146.softec-internet.com (unknown [127.0.0.1]) by vps146.softec-internet.com (Postfix) with ESMTP id E7B2961C8002 for ; Thu, 6 Sep 2012 11:20:15 +0200 (CEST) Received: from mail-ob0-f173.google.com (unknown [209.85.214.173]) by vps146.softec-internet.com (Postfix) with ESMTP for ; Thu, 6 Sep 2012 11:20:15 +0200 (CEST) Received: by obbta14 with SMTP id ta14so1831170obb.4 for ; Thu, 06 Sep 2012 02:20:14 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <50460275.2020506@redhat.com> References: <1346330948-12833-1-git-send-email-alex@securiforest.com> <50460275.2020506@redhat.com> Date: Thu, 6 Sep 2012 11:20:14 +0200 Message-ID: From: Alejandro Martinez Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] xhci: allow 1 and 2 bytes accesses to capability registers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: qemu-devel@nongnu.org Gerd, On Tue, Sep 4, 2012 at 3:30 PM, Gerd Hoffmann wrote: > On 08/30/12 14:49, Alejandro Martinez Ruiz wrote: >> Some xHC drivers (most notably on Windows and BSD systems) read >> the first capability registers using 1 and 2 bytes accesses, since >> this is how they are defined in section 5.3 of the xHCI specs. >> >> Enabling these kind of read accesses allows Windows and FreeBSD >> guests to properly recognize the host controller. >> >> As this is an exception to the general 4-byte aligned accesses rule, >> we special-case the code path for capability reading and implement >> checks to guard against wrong size/alignment combinations. > > No need to do that by hand, the memory api can handle it. Can you check > whenever usb-next > (http://www.kraxel.org/cgit/qemu/log/?h=3Drebase/usb-next) works for you? usb-next will fail to compile using -Werror with: hcd-xhci.c: In function =91xhci_fire_ctl_transfer=92: hcd-xhci.c:1508:14: error: variable =91wLength=92 set but not used [-Werror=3Dunused-but-set-variable] It will also crash at runtime at host-linux.c:usb_handle_control_packet(), since a NULL value is passed from xhci_address_slot() for the USBPacket *p argument, and an assert is testing for p->result =3D=3D 0. Other than that, this problem is resolved. I will perform further testing and report back, since the in-tree xHC driver has never really worked with any guest other than Linux. Thanks, Alex