qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 0cd089: hw/usb/dev-hid: Improve guest compati


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 0cd089: hw/usb/dev-hid: Improve guest compatibility of usb...
Date: Mon, 06 Feb 2017 04:30:10 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 0cd089e937f28a1f6f4db711f643df36f8f5dfe3
      
https://github.com/qemu/qemu/commit/0cd089e937f28a1f6f4db711f643df36f8f5dfe3
  Author: Phil Dennis-Jordan <address@hidden>
  Date:   2017-02-06 (Mon, 06 Feb 2017)

  Changed paths:
    M hw/usb/dev-hid.c

  Log Message:
  -----------
  hw/usb/dev-hid: Improve guest compatibility of usb-tablet

 1. Set bInterfaceProtocol to 0x00 for usb-tablet. This should be
    non-zero for boot protocol devices only, which the usb-tablet is not.
 2. Set the usb-tablet's usage to "mouse" in the report descriptor.

The boot protocol of 0x02 specifically confused OS X/macOS' HID driver
stack, causing it to generate additional bogus HID events with relative
motion in addition to the tablet's absolute coordinate events.

Absolute pointing devices with HID Report Descriptor usage of 0x01
(pointing) are treated by the macOS HID driver as analog sticks, and
absolute coordinates are not directly translated to absolute mouse
cursor positions. Changing it to 0x02 (mouse) fixes the problem, and
does not have any adverse effect in other operating systems and
windowing systems. (VMWare does the same thing.)

Signed-off-by: Phil Dennis-Jordan <address@hidden>
Message-id: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>


  Commit: e306b2fd3bce369feb05e2510299f81d71bc6092
      
https://github.com/qemu/qemu/commit/e306b2fd3bce369feb05e2510299f81d71bc6092
  Author: Gerd Hoffmann <address@hidden>
  Date:   2017-02-06 (Mon, 06 Feb 2017)

  Changed paths:
    M hw/usb/dev-uas.c

  Log Message:
  -----------
  usb/uas: more verbose error message

Print some more details in case we get a unknown
control request, to ease trouble-shooting.

Signed-off-by: Gerd Hoffmann <address@hidden>
Message-id: address@hidden


  Commit: 811ad5d8f1d3f35240043fe880d34dce6f2097a3
      
https://github.com/qemu/qemu/commit/811ad5d8f1d3f35240043fe880d34dce6f2097a3
  Author: Gerd Hoffmann <address@hidden>
  Date:   2017-02-06 (Mon, 06 Feb 2017)

  Changed paths:
    M hw/usb/desc.c
    M include/hw/usb.h

  Log Message:
  -----------
  usb: accept usb3 control requests

Windows 10 reportedly sends these, so accept them in case
the device in question is a superspeed (usb3) device.

Signed-off-by: Gerd Hoffmann <address@hidden>
Message-id: address@hidden


  Commit: f94d18d6c6df388fde196d3ab252f57e33843a8b
      
https://github.com/qemu/qemu/commit/f94d18d6c6df388fde196d3ab252f57e33843a8b
  Author: Gerd Hoffmann <address@hidden>
  Date:   2017-02-06 (Mon, 06 Feb 2017)

  Changed paths:
    M hw/usb/hcd-xhci.c

  Log Message:
  -----------
  xhci: only free completed transfers

Most callsites check already, one was missed.

Cc: address@hidden
Fixes: 94b037f2a451b3dc855f9f2c346e5049a361bd55
Reported-by: Fabian Lesniak <address@hidden>
Signed-off-by: Gerd Hoffmann <address@hidden>
Message-id: address@hidden


  Commit: 13e8ff7abbf1dde46280536ab4fae5012661b8b0
      
https://github.com/qemu/qemu/commit/13e8ff7abbf1dde46280536ab4fae5012661b8b0
  Author: Gerd Hoffmann <address@hidden>
  Date:   2017-02-06 (Mon, 06 Feb 2017)

  Changed paths:
    M hw/usb/hcd-xhci.c

  Log Message:
  -----------
  xhci: rename xhci_complete_packet to xhci_try_complete_packet

Make clear that this isn't guaranteed to actually complete the transfer,
the usb packet can still be in flight after calling that function.

Signed-off-by: Gerd Hoffmann <address@hidden>
Message-id: address@hidden


  Commit: ddb603ab6c981c1d67cb42266fc700c33e5b2d8f
      
https://github.com/qemu/qemu/commit/ddb603ab6c981c1d67cb42266fc700c33e5b2d8f
  Author: Gerd Hoffmann <address@hidden>
  Date:   2017-02-06 (Mon, 06 Feb 2017)

  Changed paths:
    M hw/usb/hcd-xhci.c

  Log Message:
  -----------
  xhci: don't kick in xhci_submit and xhci_fire_ctl_transfer

xhci_submit and xhci_fire_ctl_transfer are is called from
xhci_kick_epctx processing loop only, so there is no need to call
xhci_kick_epctx make sure processing continues.  Also eecursive calls
into xhci_kick_epctx can cause trouble.

Drop the xhci_kick_epctx calls.

Cc: address@hidden
Fixes: 94b037f2a451b3dc855f9f2c346e5049a361bd55
Reported-by: Fabian Lesniak <address@hidden>
Signed-off-by: Gerd Hoffmann <address@hidden>
Message-id: address@hidden


  Commit: 96d87bdda3919bb16f754b3d3fd1227e1f38f13c
      
https://github.com/qemu/qemu/commit/96d87bdda3919bb16f754b3d3fd1227e1f38f13c
  Author: Gerd Hoffmann <address@hidden>
  Date:   2017-02-06 (Mon, 06 Feb 2017)

  Changed paths:
    M hw/usb/hcd-xhci.c

  Log Message:
  -----------
  xhci: guard xhci_kick_epctx against recursive calls

Track xhci_kick_epctx processing being active in a variable.  Check the
variable before calling xhci_kick_epctx from xhci_kick_ep.  Add an
assert to make sure we don't call recursively into xhci_kick_epctx.

Cc: address@hidden
Fixes: 94b037f2a451b3dc855f9f2c346e5049a361bd55
Reported-by: Fabian Lesniak <address@hidden>
Signed-off-by: Gerd Hoffmann <address@hidden>
Message-id: address@hidden
Message-id: address@hidden


  Commit: c7dfbf322595ded4e70b626bf83158a9f3807c6a
      
https://github.com/qemu/qemu/commit/c7dfbf322595ded4e70b626bf83158a9f3807c6a
  Author: Prasad J Pandit <address@hidden>
  Date:   2017-02-06 (Mon, 06 Feb 2017)

  Changed paths:
    M hw/usb/dev-smartcard-reader.c

  Log Message:
  -----------
  usb: ccid: check ccid apdu length

CCID device emulator uses Application Protocol Data Units(APDU)
to exchange command and responses to and from the host.
The length in these units couldn't be greater than 65536. Add
check to ensure the same. It'd also avoid potential integer
overflow in emulated_apdu_from_guest.

Reported-by: Li Qiang <address@hidden>
Signed-off-by: Prasad J Pandit <address@hidden>
Message-id: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>


  Commit: 7da76e12cc5cc902dda4c168d8d608fd4e61cbc5
      
https://github.com/qemu/qemu/commit/7da76e12cc5cc902dda4c168d8d608fd4e61cbc5
  Author: Gerd Hoffmann <address@hidden>
  Date:   2017-02-06 (Mon, 06 Feb 2017)

  Changed paths:
    M hw/usb/hcd-xhci.c

  Log Message:
  -----------
  xhci: fix event queue IRQ handling

The qemu xhci emulation doesn't handle the ERDP_EHB flag correctly.

When the host adapter queues a new event the ERDP_EHB flag is set.  The
flag is cleared (via w1c) by the guest when it updates the ERDP (event
ring dequeue pointer) register to notify the host adapter which events
it has fetched.

An IRQ must be raised in case the ERDP_EHB flag flips from clear to set.
If the flag is set already (which implies there are events queued up
which are not yet processed by the guest) xhci must *not* raise a IRQ.

Qemu got that wrong and raised an IRQ on every event, thereby generating
spurious interrupts in case we've queued events faster than the guest
processed them.  This patch fixes that.

With that change in place we also have to check ERDP updates, to see
whenever the guest has fetched all queued events.  In case there are
still pending events set ERDP_EHB and raise an IRQ again, to make sure
the events don't linger unseen forever.

The linux kernel driver and the microsoft windows driver (shipped with
win8+) can deal with the spurious interrupts without problems.  The
renesas windows driver (v2.1.39) which can be used on older windows
versions is quite upset though.  It does spurious ERDP updates now and
then (not every time, seems we must hit a race window for this to
happen), which in turn makes the qemu xhci emulation think the event
ring is full.  Things go south from here ...

tl;dr: This is the "fix xhci on win7" patch.

Cc: address@hidden
Cc: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>
Message-id: address@hidden


  Commit: 7d2c6c95511e42dffe2b263275e09957723d0ff4
      
https://github.com/qemu/qemu/commit/7d2c6c95511e42dffe2b263275e09957723d0ff4
  Author: Peter Maydell <address@hidden>
  Date:   2017-02-06 (Mon, 06 Feb 2017)

  Changed paths:
    M hw/usb/desc.c
    M hw/usb/dev-hid.c
    M hw/usb/dev-smartcard-reader.c
    M hw/usb/dev-uas.c
    M hw/usb/hcd-xhci.c
    M include/hw/usb.h

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/kraxel/tags/pull-usb-20170206-1' into 
staging

usb: various bugfixes, mostly xhci.

# gpg: Signature made Mon 06 Feb 2017 11:26:35 GMT
# gpg:                using RSA key 0x4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <address@hidden>"
# gpg:                 aka "Gerd Hoffmann <address@hidden>"
# gpg:                 aka "Gerd Hoffmann (private) <address@hidden>"
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/pull-usb-20170206-1:
  xhci: fix event queue IRQ handling
  usb: ccid: check ccid apdu length
  xhci: guard xhci_kick_epctx against recursive calls
  xhci: don't kick in xhci_submit and xhci_fire_ctl_transfer
  xhci: rename xhci_complete_packet to xhci_try_complete_packet
  xhci: only free completed transfers
  usb: accept usb3 control requests
  usb/uas: more verbose error message
  hw/usb/dev-hid: Improve guest compatibility of usb-tablet

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/c192325242f0...7d2c6c95511e

reply via email to

[Prev in Thread] Current Thread [Next in Thread]