Skip to contentSkip to conversation

usb: xhci assert fix, add usbredir streams property

GIT PULL Applied Gerd Hoffmann 2 participants 4 messages Jul 20, 2016

lore
Share & tools
lore
#0 lore raw

Hi,

Here is the usb patch queue with two small fixes.

please pull,
Gerd

The following changes since commit 5d3217340adcb6c4f0e4af5d2b865331eb2ff63d:

disas: Fix ATTRIBUTE_UNUSED define clash with ALSA headers (2016-07-19 16:40:39 +0100)

are available in the git repository at:

git://git.kraxel.org/qemu tags/pull-usb-20160720-1

for you to fetch changes up to 87ae924b73cbbe13ad800ab2016d011b42456f25:

usbredir: add streams property (2016-07-20 13:31:20 +0200)

----------------------------------------------------------------
usb: xhci assert fix, add usbredir streams property

----------------------------------------------------------------
Alexey Kardashevskiy (1):
xhci: Fix possible side effect from assert()

Gerd Hoffmann (1):
usbredir: add streams property

 hw/usb/hcd-xhci.c | 4 +++-
 hw/usb/redirect.c | 6 +++++-
 2 files changed, 8 insertions(+), 2 deletions(-)
#1 lore raw

[Qemu-devel] [PULL 1/2] xhci: Fix possible side effect from assert()

From: Alexey Kardashevskiy <[email protected]>

A static analysis tool called BEAM detected possible side effect from assert() calling a helper which may change an XHCI ring after every call.

This moves xhci_ring_fetch() out of assert() so it will be called with and without enabled debug.

Message-id: [email protected]

---
 hw/usb/hcd-xhci.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
hw/usb/hcd-xhci.c +3 -1
index 976bfb0..188f954 100644
@@ -2201,7 +2201,9 @@ static void xhci_kick_ep(XHCIState *xhci, unsigned int slotid,
         xfer->trb_count = length;
 
         for (i = 0; i < length; i++) {
-            assert(xhci_ring_fetch(xhci, ring, &xfer->trbs[i], NULL));
+            TRBType type;
+            type = xhci_ring_fetch(xhci, ring, &xfer->trbs[i], NULL);
+            assert(type);
         }
         xfer->streamid = streamid;
 
Signature · 1 line
1.8.3.1
#2 lore raw

[Qemu-devel] [PULL 2/2] usbredir: add streams property

In reply to Gerd Hoffmann

Enabled by default, can be used to turn off (usb3) streams support. xhci has a such a property too (same name, same default).

Message-id: [email protected]

---
 hw/usb/redirect.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
hw/usb/redirect.c +5 -1
index 8ec8484..444672a 100644
@@ -109,6 +109,7 @@ struct USBRedirDevice {
     uint8_t debug;
     char *filter_str;
     int32_t bootindex;
+    bool enable_streams;
     /* Data passed from chardev the fd_read cb to the usbredirparser read cb */
     const uint8_t *read_buf;
     int read_buf_size;
@@ -1229,7 +1230,9 @@ static void usbredir_create_parser(USBRedirDevice *dev)
     usbredirparser_caps_set_cap(caps, usb_redir_cap_32bits_bulk_length);
     usbredirparser_caps_set_cap(caps, usb_redir_cap_bulk_receiving);
 #if USBREDIR_VERSION >= 0x000700
-    usbredirparser_caps_set_cap(caps, usb_redir_cap_bulk_streams);
+    if (dev->enable_streams) {
+        usbredirparser_caps_set_cap(caps, usb_redir_cap_bulk_streams);
+    }
 #endif
 
     if (runstate_check(RUN_STATE_INMIGRATE)) {
@@ -2476,6 +2479,7 @@ static Property usbredir_properties[] = {
     DEFINE_PROP_CHR("chardev", USBRedirDevice, cs),
     DEFINE_PROP_UINT8("debug", USBRedirDevice, debug, usbredirparser_warning),
     DEFINE_PROP_STRING("filter", USBRedirDevice, filter_str),
+    DEFINE_PROP_BOOL("streams", USBRedirDevice, enable_streams, true),
     DEFINE_PROP_END_OF_LIST(),
 };
 
Signature · 1 line
1.8.3.1
#3 lore raw
In reply to Gerd Hoffmann
Quoted 15 lines · Gerd Hoffmann

Hi,

Here is the usb patch queue with two small fixes.

please pull,
Gerd

The following changes since commit 5d3217340adcb6c4f0e4af5d2b865331eb2ff63d:

disas: Fix ATTRIBUTE_UNUSED define clash with ALSA headers (2016-07-19 16:40:39 +0100)

are available in the git repository at:

git://git.kraxel.org/qemu tags/pull-usb-20160720-1

Quoted 8 lines

for you to fetch changes up to 87ae924b73cbbe13ad800ab2016d011b42456f25:

usbredir: add streams property (2016-07-20 13:31:20 +0200)

----------------------------------------------------------------
usb: xhci assert fix, add usbredir streams property

----------------------------------------------------------------

Applied, thanks.

-- PMM