From nobody Sun May 5 09:00:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1494592027822250.01468806338096; Fri, 12 May 2017 05:27:07 -0700 (PDT) Received: from localhost ([::1]:53519 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d99f0-0003u8-H0 for importer@patchew.org; Fri, 12 May 2017 08:27:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41313) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d99aJ-0000Tj-Um for qemu-devel@nongnu.org; Fri, 12 May 2017 08:22:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d99aH-0005BH-Uy for qemu-devel@nongnu.org; Fri, 12 May 2017 08:22:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47344) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d99aH-0005Aa-M7 for qemu-devel@nongnu.org; Fri, 12 May 2017 08:22:13 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AB414C04B94A for ; Fri, 12 May 2017 12:22:12 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-243.ams2.redhat.com [10.36.116.243]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9350681862; Fri, 12 May 2017 12:22:02 +0000 (UTC) Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 64DAC81826; Fri, 12 May 2017 14:22:00 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com AB414C04B94A Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=kraxel@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com AB414C04B94A From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 12 May 2017 14:21:53 +0200 Message-Id: <20170512122158.32032-2-kraxel@redhat.com> In-Reply-To: <20170512122158.32032-1-kraxel@redhat.com> References: <20170512122158.32032-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 12 May 2017 12:22:12 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 1/6] qemu-doc: Update to use the new way of attaching USB devices X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Thomas Huth The preferred way of adding USB devices is via "-device" and "device_add" nowadays, so let's start to get rid of "-usbdevice" and "usb_add" in the documentation. While we're at it, also add the new USB devices there which have been added to QEMU during the last years, and get rid of the old "vendorid" and "productid" parameters of "-usbdevice serial" which have been removed in QEMU version 0.14.0 already. Reviewed-by: Markus Armbruster Signed-off-by: Thomas Huth Message-id: 1494256429-31720-1-git-send-email-thuth@redhat.com Signed-off-by: Gerd Hoffmann --- docs/qdev-device-use.txt | 6 ++-- qemu-doc.texi | 91 +++++++++++++++++++++++++++-----------------= ---- 2 files changed, 53 insertions(+), 44 deletions(-) diff --git a/docs/qdev-device-use.txt b/docs/qdev-device-use.txt index b059405e0e..4274fe9f25 100644 --- a/docs/qdev-device-use.txt +++ b/docs/qdev-device-use.txt @@ -182,15 +182,13 @@ The appropriate DEVNAME depends on the machine type. = For type "pc": =20 This lets you control I/O ports and IRQs. =20 -* -usbdevice serial:vendorid=3DVID,productid=3DPRID becomes - -device usb-serial,vendorid=3DVID,productid=3DPRID +* -usbdevice serial::chardev becomes -device usb-serial,chardev=3Ddev. =20 * -usbdevice braille doesn't support LEGACY-CHARDEV syntax. It always uses "braille". With -device, this useful default is gone, so you have to use something like =20 - -device usb-braille,chardev=3Dbraille,vendorid=3DVID,productid=3DPRID - -chardev braille,id=3Dbraille + -device usb-braille,chardev=3Dbraille -chardev braille,id=3Dbraille =20 * -virtioconsole becomes -device virtio-serial-pci,class=3DC,vectors=3DV,ioeventfd=3DIOEVENTFD,ma= x_ports=3DN diff --git a/qemu-doc.texi b/qemu-doc.texi index 794ab4a080..59d0ccb582 100644 --- a/qemu-doc.texi +++ b/qemu-doc.texi @@ -182,7 +182,7 @@ Gravis Ultrasound GF1 sound card @item CS4231A compatible sound card @item -PCI UHCI USB controller and a virtual USB hub. +PCI UHCI, OHCI, EHCI or XHCI USB controller and a virtual USB-1.1 hub. @end itemize =20 SMP is supported with up to 255 CPUs. @@ -1357,10 +1357,10 @@ monitor (@pxref{pcsys_keys}). @node pcsys_usb @section USB emulation =20 -QEMU emulates a PCI UHCI USB controller. You can virtually plug -virtual USB devices or real host USB devices (experimental, works only -on Linux hosts). QEMU will automatically create and connect virtual USB h= ubs -as necessary to connect multiple USB devices. +QEMU can emulate a PCI UHCI, OHCI, EHCI or XHCI USB controller. You can +plug virtual USB devices or real host USB devices (only works with certain +host operating systems). QEMU will automatically create and connect virtual +USB hubs as necessary to connect multiple USB devices. =20 @menu * usb_devices:: @@ -1369,53 +1369,64 @@ as necessary to connect multiple USB devices. @node usb_devices @subsection Connecting USB devices =20 -USB devices can be connected with the @option{-usbdevice} commandline opti= on -or the @code{usb_add} monitor command. Available devices are: +USB devices can be connected with the @option{-device usb-...} command line +option or the @code{device_add} monitor command. Available devices are: =20 @table @code -@item mouse +@item usb-mouse Virtual Mouse. This will override the PS/2 mouse emulation when activated. -@item tablet +@item usb-tablet Pointer device that uses absolute coordinates (like a touchscreen). This means QEMU is able to report the mouse position without having to grab the mouse. Also overrides the PS/2 mouse emulation when activated. -@item disk:@var{file} -Mass storage device based on @var{file} (@pxref{disk_images}) -@item host:@var{bus.addr} -Pass through the host device identified by @var{bus.addr} -(Linux only) -@item host:@var{vendor_id:product_id} -Pass through the host device identified by @var{vendor_id:product_id} -(Linux only) -@item wacom-tablet +@item usb-storage,drive=3D@var{drive_id} +Mass storage device backed by @var{drive_id} (@pxref{disk_images}) +@item usb-uas +USB attached SCSI device, see +@url{http://git.qemu.org/?p=3Dqemu.git;a=3Dblob_plain;f=3Ddocs/usb-storage= .txt,usb-storage.txt} +for details +@item usb-bot +Bulk-only transport storage device, see +@url{http://git.qemu.org/?p=3Dqemu.git;a=3Dblob_plain;f=3Ddocs/usb-storage= .txt,usb-storage.txt} +for details here, too +@item usb-mtp,x-root=3D@var{dir} +Media transfer protocol device, using @var{dir} as root of the file tree +that is presented to the guest. +@item usb-host,hostbus=3D@var{bus},hostaddr=3D@var{addr} +Pass through the host device identified by @var{bus} and @var{addr} +@item usb-host,vendorid=3D@var{vendor},productid=3D@var{product} +Pass through the host device identified by @var{vendor} and @var{product} = ID +@item usb-wacom-tablet Virtual Wacom PenPartner tablet. This device is similar to the @code{tabl= et} above but it can be used with the tslib library because in addition to tou= ch coordinates it reports touch pressure. -@item keyboard +@item usb-kbd Standard USB keyboard. Will override the PS/2 keyboard (if present). -@item serial:[vendorid=3D@var{vendor_id}][,product_id=3D@var{product_id}]:= @var{dev} +@item usb-serial,chardev=3D@var{id} Serial converter. This emulates an FTDI FT232BM chip connected to host cha= racter -device @var{dev}. The available character devices are the same as for the -@code{-serial} option. The @code{vendorid} and @code{productid} options ca= n be -used to override the default 0403:6001. For instance, -@example -usb_add serial:productid=3DFA00:tcp:192.168.0.2:4444 -@end example -will connect to tcp port 4444 of ip 192.168.0.2, and plug that to the virt= ual -serial converter, faking a Matrix Orbital LCD Display (USB ID 0403:FA00). -@item braille +device @var{id}. +@item usb-braille,chardev=3D@var{id} Braille device. This will use BrlAPI to display the braille output on a r= eal -or fake device. -@item net:@var{options} -Network adapter that supports CDC ethernet and RNDIS protocols. @var{opti= ons} -specifies NIC options as with @code{-net nic,}@var{options} (see descripti= on). +or fake device referenced by @var{id}. +@item usb-net[,netdev=3D@var{id}] +Network adapter that supports CDC ethernet and RNDIS protocols. @var{id} +specifies a netdev defined with @code{-netdev @dots{},id=3D@var{id}}. For instance, user-mode networking can be used with @example -qemu-system-i386 [...OPTIONS...] -net user,vlan=3D0 -usbdevice net:vlan=3D0 +qemu-system-i386 [...] -netdev user,id=3Dnet0 -device usb-net,netdev=3Dnet0 @end example -Currently this cannot be used in machines that support PCI NICs. -@item bt[:@var{hci-type}] -Bluetooth dongle whose type is specified in the same format as with +@item usb-ccid +Smartcard reader device +@item usb-audio +USB audio device +@item usb-bt-dongle +Bluetooth dongle for the transport layer of HCI. It is connected to HCI +scatternet 0 by default (corresponds to @code{-bt hci,vlan=3D0}). +Note that the syntax for the @code{-device usb-bt-dongle} option is not as +useful yet as it was with the legacy @code{-usbdevice} option. So to +configure an USB bluetooth device, you might need to use +"@code{-usbdevice bt}[:@var{hci-type}]" instead. This configures a +bluetooth dongle whose type is specified in the same format as with the @option{-bt hci} option, @pxref{bt-hcis,,allowed HCI types}. If no type is given, the HCI logic corresponds to @code{-bt hci,vlan=3D0}. This USB device implements the USB Transport Layer of HCI. Example @@ -1460,11 +1471,11 @@ hubs, it won't work). =20 @item Add the device in QEMU by using: @example -usb_add host:1234:5678 +device_add usb-host,vendorid=3D0x1234,productid=3D0x5678 @end example =20 -Normally the guest OS should report that a new USB device is -plugged. You can use the option @option{-usbdevice} to do the same. +Normally the guest OS should report that a new USB device is plugged. +You can use the option @option{-device usb-host,...} to do the same. =20 @item Now you can try to use the host USB device in QEMU. =20 --=20 2.9.3 From nobody Sun May 5 09:00:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1494591932108733.741500492732; Fri, 12 May 2017 05:25:32 -0700 (PDT) Received: from localhost ([::1]:53514 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d99dS-0002qa-S5 for importer@patchew.org; Fri, 12 May 2017 08:25:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41266) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d99aE-0000Kz-2e for qemu-devel@nongnu.org; Fri, 12 May 2017 08:22:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d99aA-00056U-Rs for qemu-devel@nongnu.org; Fri, 12 May 2017 08:22:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39282) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d99aA-00055z-MC for qemu-devel@nongnu.org; Fri, 12 May 2017 08:22:06 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8421851462 for ; Fri, 12 May 2017 12:22:05 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-243.ams2.redhat.com [10.36.116.243]) by smtp.corp.redhat.com (Postfix) with ESMTP id 87DA28D57C; Fri, 12 May 2017 12:22:02 +0000 (UTC) Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 7412681827; Fri, 12 May 2017 14:22:00 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8421851462 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=kraxel@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 8421851462 From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 12 May 2017 14:21:54 +0200 Message-Id: <20170512122158.32032-3-kraxel@redhat.com> In-Reply-To: <20170512122158.32032-1-kraxel@redhat.com> References: <20170512122158.32032-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 12 May 2017 12:22:05 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 2/6] usb-redir: fix stack overflow in usbredir_log_data X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Don't reinvent a broken wheel, just use the hexdump function we have. Impact: low, broken code doesn't run unless you have debug logging enabled. Reported-by: =E6=9D=8E=E5=BC=BA Signed-off-by: Gerd Hoffmann Message-id: 20170509110128.27261-1-kraxel@redhat.com --- hw/usb/redirect.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c index b001a27f05..ad5ef783a6 100644 --- a/hw/usb/redirect.c +++ b/hw/usb/redirect.c @@ -229,21 +229,10 @@ static void usbredir_log(void *priv, int level, const= char *msg) static void usbredir_log_data(USBRedirDevice *dev, const char *desc, const uint8_t *data, int len) { - int i, j, n; - if (dev->debug < usbredirparser_debug_data) { return; } - - for (i =3D 0; i < len; i +=3D j) { - char buf[128]; - - n =3D sprintf(buf, "%s", desc); - for (j =3D 0; j < 8 && i + j < len; j++) { - n +=3D sprintf(buf + n, " %02X", data[i + j]); - } - error_report("%s", buf); - } + qemu_hexdump((char *)data, stderr, desc, len); } =20 /* --=20 2.9.3 From nobody Sun May 5 09:00:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1494591823505277.46400757343895; Fri, 12 May 2017 05:23:43 -0700 (PDT) Received: from localhost ([::1]:53503 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d99bg-0001OB-Vp for importer@patchew.org; Fri, 12 May 2017 08:23:41 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41292) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d99aE-0000Mb-Te for qemu-devel@nongnu.org; Fri, 12 May 2017 08:22:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d99aE-00058t-4V for qemu-devel@nongnu.org; Fri, 12 May 2017 08:22:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57900) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d99aD-00058Z-US for qemu-devel@nongnu.org; Fri, 12 May 2017 08:22:10 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F218F68115 for ; Fri, 12 May 2017 12:22:08 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-243.ams2.redhat.com [10.36.116.243]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8854580F9D; Fri, 12 May 2017 12:22:02 +0000 (UTC) Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 8355C81828; Fri, 12 May 2017 14:22:00 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com F218F68115 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=kraxel@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com F218F68115 From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 12 May 2017 14:21:55 +0200 Message-Id: <20170512122158.32032-4-kraxel@redhat.com> In-Reply-To: <20170512122158.32032-1-kraxel@redhat.com> References: <20170512122158.32032-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 12 May 2017 12:22:09 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 3/6] xhci: fix logging X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ladi Prosek , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Ladi Prosek slotid and epid were deleted from XHCITransfer in commit d6fcb29. Also deleting one unused forward declaration. Signed-off-by: Ladi Prosek Message-id: 20170511125314.24549-2-lprosek@redhat.com Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-xhci.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index a2d3143bf4..d3d47bf925 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.c @@ -1790,9 +1790,6 @@ static void xhci_stall_ep(XHCITransfer *xfer) } } =20 -static int xhci_submit(XHCIState *xhci, XHCITransfer *xfer, - XHCIEPContext *epctx); - static int xhci_setup_packet(XHCITransfer *xfer) { USBEndpoint *ep; @@ -1806,7 +1803,7 @@ static int xhci_setup_packet(XHCITransfer *xfer) ep =3D xhci_epid_to_usbep(xfer->epctx); if (!ep) { DPRINTF("xhci: slot %d has no device\n", - xfer->slotid); + xfer->epctx->slotid); return -1; } } @@ -1980,7 +1977,7 @@ static int xhci_submit(XHCIState *xhci, XHCITransfer = *xfer, XHCIEPContext *epctx { uint64_t mfindex; =20 - DPRINTF("xhci_submit(slotid=3D%d,epid=3D%d)\n", xfer->slotid, xfer->ep= id); + DPRINTF("xhci_submit(slotid=3D%d,epid=3D%d)\n", epctx->slotid, epctx->= epid); =20 xfer->in_xfer =3D epctx->type>>2; =20 --=20 2.9.3 From nobody Sun May 5 09:00:46 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 149459193353434.20056525923985; Fri, 12 May 2017 05:25:33 -0700 (PDT) Received: from localhost ([::1]:53515 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d99dU-0002rW-70 for importer@patchew.org; Fri, 12 May 2017 08:25:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41267) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d99aE-0000L0-2o for qemu-devel@nongnu.org; Fri, 12 May 2017 08:22:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d99aB-00056e-0T for qemu-devel@nongnu.org; Fri, 12 May 2017 08:22:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:2629) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d99aA-000569-Q2 for qemu-devel@nongnu.org; Fri, 12 May 2017 08:22:06 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CA85E3DBD5 for ; Fri, 12 May 2017 12:22:05 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-243.ams2.redhat.com [10.36.116.243]) by smtp.corp.redhat.com (Postfix) with ESMTP id 932994DA83; Fri, 12 May 2017 12:22:02 +0000 (UTC) Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 941E081829; Fri, 12 May 2017 14:22:00 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com CA85E3DBD5 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=kraxel@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com CA85E3DBD5 From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 12 May 2017 14:21:56 +0200 Message-Id: <20170512122158.32032-5-kraxel@redhat.com> In-Reply-To: <20170512122158.32032-1-kraxel@redhat.com> References: <20170512122158.32032-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 12 May 2017 12:22:05 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 4/6] usb-hub: clear PORT_STAT_SUSPEND on wakeup X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ladi Prosek , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Ladi Prosek The spec says: Suspend: (PORT_SUSPEND) This field indicates whether or not the device on this port is suspended. Setting this field causes the device to suspend by not propagating bus traffic downstream. This field may be reset by a request or by resume signaling from the device attached to the port. I can't find any specific statement like "the PORT_SUSPEND field is reset automatically on remote wakeup", but without this patch, the only way to reset it is via the ClearPortFeature request so the ".. or by resume signaling from the device" clause is clearly not implemented on the remote wakeup path. The default xhci Windows driver does not issue the ClearPortFeature request and suspended devices attached to a hub don't properly get out of the suspended state. Interestingly, the default uhci Windows driver *does* issue the ClearPortFeature request and does not exhibit this problem. Signed-off-by: Ladi Prosek Message-id: 20170511125314.24549-3-lprosek@redhat.com Signed-off-by: Gerd Hoffmann --- hw/usb/dev-hub.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/usb/dev-hub.c b/hw/usb/dev-hub.c index 9fe7333946..47b7519910 100644 --- a/hw/usb/dev-hub.c +++ b/hw/usb/dev-hub.c @@ -208,6 +208,7 @@ static void usb_hub_wakeup(USBPort *port1) USBHubPort *port =3D &s->ports[port1->index]; =20 if (port->wPortStatus & PORT_STAT_SUSPEND) { + port->wPortStatus &=3D ~PORT_STAT_SUSPEND; port->wPortChange |=3D PORT_STAT_C_SUSPEND; usb_wakeup(s->intr, 0); } --=20 2.9.3 From nobody Sun May 5 09:00:46 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1494591832806385.0876961795425; Fri, 12 May 2017 05:23:52 -0700 (PDT) Received: from localhost ([::1]:53504 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d99br-0001We-3g for importer@patchew.org; Fri, 12 May 2017 08:23:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41330) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d99aN-0000ec-99 for qemu-devel@nongnu.org; Fri, 12 May 2017 08:22:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d99aK-0005DM-VC for qemu-devel@nongnu.org; Fri, 12 May 2017 08:22:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56474) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d99aK-0005D4-Po for qemu-devel@nongnu.org; Fri, 12 May 2017 08:22:16 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C23F43DBEE for ; Fri, 12 May 2017 12:22:15 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-243.ams2.redhat.com [10.36.116.243]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7FF7317AD4; Fri, 12 May 2017 12:22:13 +0000 (UTC) Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id A49BD81823; Fri, 12 May 2017 14:22:00 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C23F43DBEE Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=kraxel@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com C23F43DBEE From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 12 May 2017 14:21:57 +0200 Message-Id: <20170512122158.32032-6-kraxel@redhat.com> In-Reply-To: <20170512122158.32032-1-kraxel@redhat.com> References: <20170512122158.32032-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 12 May 2017 12:22:15 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 5/6] xhci: relax link check X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ladi Prosek , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Ladi Prosek The strict td link limit added by commit "05f43d4 xhci: limit the number of link trbs we are willing to process" causes problems with Windows guests. Let's raise the limit. This change is analogous to: commit ab6b1105a2259c7072905887f71caa850ce63190 Author: Gerd Hoffmann Date: Tue Mar 7 09:40:18 2017 +0100 ohci: relax link check Signed-off-by: Ladi Prosek Message-id: 20170512102100.22675-1-lprosek@redhat.com Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-xhci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index d3d47bf925..77d8e1137a 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.c @@ -50,7 +50,7 @@ /* Very pessimistic, let's hope it's enough for all cases */ #define EV_QUEUE (((3 * 24) + 16) * MAXSLOTS) =20 -#define TRB_LINK_LIMIT 4 +#define TRB_LINK_LIMIT 32 #define COMMAND_LIMIT 256 #define TRANSFER_LIMIT 256 =20 --=20 2.9.3 From nobody Sun May 5 09:00:46 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1494592026988953.1718628802108; Fri, 12 May 2017 05:27:06 -0700 (PDT) Received: from localhost ([::1]:53518 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d99ez-0003tO-PQ for importer@patchew.org; Fri, 12 May 2017 08:27:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41329) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d99aN-0000eb-98 for qemu-devel@nongnu.org; Fri, 12 May 2017 08:22:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d99aL-0005DU-DR for qemu-devel@nongnu.org; Fri, 12 May 2017 08:22:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:10737) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d99aL-0005DB-4F for qemu-devel@nongnu.org; Fri, 12 May 2017 08:22:17 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 28994804E2; Fri, 12 May 2017 12:22:16 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-243.ams2.redhat.com [10.36.116.243]) by smtp.corp.redhat.com (Postfix) with ESMTP id B07F517DB0; Fri, 12 May 2017 12:22:13 +0000 (UTC) Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id B51B48182B; Fri, 12 May 2017 14:22:00 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 28994804E2 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=kraxel@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 28994804E2 From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 12 May 2017 14:21:58 +0200 Message-Id: <20170512122158.32032-7-kraxel@redhat.com> In-Reply-To: <20170512122158.32032-1-kraxel@redhat.com> References: <20170512122158.32032-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 12 May 2017 12:22:16 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 6/6] hw/usb/dev-serial: Do not try to set vendorid or productid properties X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Samuel Thibault , Thomas Huth , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Thomas Huth When starting QEMU with the legacy USB serial device like this: qemu-system-x86_64 -usbdevice serial:vendorid=3D0x1234:stdio it currently aborts since the vendorid property does not exist anymore (it has been removed by commit f29783f72ea77dfbd7ea0c9): Unexpected error in object_property_find() at qemu/qom/object.c:1008: qemu-system-x86_64: -usbdevice serial:vendorid=3D0x1234:stdio: Property '.vendorid' not found Aborted (core dumped) Fix this crash by issuing a more friendly error message instead (and simplify the code also a little bit this way). Signed-off-by: Thomas Huth Message-id: 1493883704-27604-1-git-send-email-thuth@redhat.com Signed-off-by: Gerd Hoffmann --- hw/usb/dev-serial.c | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/hw/usb/dev-serial.c b/hw/usb/dev-serial.c index 6d5137383b..83a4f0e6fb 100644 --- a/hw/usb/dev-serial.c +++ b/hw/usb/dev-serial.c @@ -513,27 +513,18 @@ static USBDevice *usb_serial_init(USBBus *bus, const = char *filename) { USBDevice *dev; Chardev *cdrv; - uint32_t vendorid =3D 0, productid =3D 0; char label[32]; static int index; =20 while (*filename && *filename !=3D ':') { const char *p; - char *e; + if (strstart(filename, "vendorid=3D", &p)) { - vendorid =3D strtol(p, &e, 16); - if (e =3D=3D p || (*e && *e !=3D ',' && *e !=3D ':')) { - error_report("bogus vendor ID %s", p); - return NULL; - } - filename =3D e; + error_report("vendorid is not supported anymore"); + return NULL; } else if (strstart(filename, "productid=3D", &p)) { - productid =3D strtol(p, &e, 16); - if (e =3D=3D p || (*e && *e !=3D ',' && *e !=3D ':')) { - error_report("bogus product ID %s", p); - return NULL; - } - filename =3D e; + error_report("productid is not supported anymore"); + return NULL; } else { error_report("unrecognized serial USB option %s", filename); return NULL; @@ -554,10 +545,7 @@ static USBDevice *usb_serial_init(USBBus *bus, const c= har *filename) =20 dev =3D usb_create(bus, "usb-serial"); qdev_prop_set_chr(&dev->qdev, "chardev", cdrv); - if (vendorid) - qdev_prop_set_uint16(&dev->qdev, "vendorid", vendorid); - if (productid) - qdev_prop_set_uint16(&dev->qdev, "productid", productid); + return dev; } =20 --=20 2.9.3