* [Qemu-devel] [PULL for-2.7 0/2] usb: xhci assert fix, add usbredir streams property
@ 2016-07-20 12:58 Gerd Hoffmann
2016-07-20 12:58 ` [Qemu-devel] [PULL 1/2] xhci: Fix possible side effect from assert() Gerd Hoffmann
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Gerd Hoffmann @ 2016-07-20 12:58 UTC (permalink / raw)
To: qemu-devel; +Cc: 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
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(-)
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Qemu-devel] [PULL 1/2] xhci: Fix possible side effect from assert()
2016-07-20 12:58 [Qemu-devel] [PULL for-2.7 0/2] usb: xhci assert fix, add usbredir streams property Gerd Hoffmann
@ 2016-07-20 12:58 ` Gerd Hoffmann
2016-07-20 12:58 ` [Qemu-devel] [PULL 2/2] usbredir: add streams property Gerd Hoffmann
2016-07-20 19:57 ` [Qemu-devel] [PULL for-2.7 0/2] usb: xhci assert fix, add usbredir " Peter Maydell
2 siblings, 0 replies; 4+ messages in thread
From: Gerd Hoffmann @ 2016-07-20 12:58 UTC (permalink / raw)
To: qemu-devel; +Cc: Alexey Kardashevskiy, Gerd Hoffmann
From: Alexey Kardashevskiy <aik@ozlabs.ru>
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.
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Message-id: 1468812548-31868-1-git-send-email-aik@ozlabs.ru
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/usb/hcd-xhci.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index 976bfb0..188f954 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -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;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Qemu-devel] [PULL 2/2] usbredir: add streams property
2016-07-20 12:58 [Qemu-devel] [PULL for-2.7 0/2] usb: xhci assert fix, add usbredir streams property Gerd Hoffmann
2016-07-20 12:58 ` [Qemu-devel] [PULL 1/2] xhci: Fix possible side effect from assert() Gerd Hoffmann
@ 2016-07-20 12:58 ` Gerd Hoffmann
2016-07-20 19:57 ` [Qemu-devel] [PULL for-2.7 0/2] usb: xhci assert fix, add usbredir " Peter Maydell
2 siblings, 0 replies; 4+ messages in thread
From: Gerd Hoffmann @ 2016-07-20 12:58 UTC (permalink / raw)
To: qemu-devel; +Cc: 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).
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 1468408474-17648-1-git-send-email-kraxel@redhat.com
---
hw/usb/redirect.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c
index 8ec8484..444672a 100644
--- a/hw/usb/redirect.c
+++ b/hw/usb/redirect.c
@@ -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(),
};
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PULL for-2.7 0/2] usb: xhci assert fix, add usbredir streams property
2016-07-20 12:58 [Qemu-devel] [PULL for-2.7 0/2] usb: xhci assert fix, add usbredir streams property Gerd Hoffmann
2016-07-20 12:58 ` [Qemu-devel] [PULL 1/2] xhci: Fix possible side effect from assert() Gerd Hoffmann
2016-07-20 12:58 ` [Qemu-devel] [PULL 2/2] usbredir: add streams property Gerd Hoffmann
@ 2016-07-20 19:57 ` Peter Maydell
2 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2016-07-20 19:57 UTC (permalink / raw)
To: Gerd Hoffmann; +Cc: QEMU Developers
On 20 July 2016 at 13:58, Gerd Hoffmann <kraxel@redhat.com> wrote:
> 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
>
> ----------------------------------------------------------------
Applied, thanks.
-- PMM
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-07-20 19:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-20 12:58 [Qemu-devel] [PULL for-2.7 0/2] usb: xhci assert fix, add usbredir streams property Gerd Hoffmann
2016-07-20 12:58 ` [Qemu-devel] [PULL 1/2] xhci: Fix possible side effect from assert() Gerd Hoffmann
2016-07-20 12:58 ` [Qemu-devel] [PULL 2/2] usbredir: add streams property Gerd Hoffmann
2016-07-20 19:57 ` [Qemu-devel] [PULL for-2.7 0/2] usb: xhci assert fix, add usbredir " Peter Maydell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).