Skip to content

USB 3 for vUSB #6389

Open
Open
@stormi

Description

@stormi

QEMU supports USB3 emulation, but XAPI only offers USB2 . We made a test with a USB storage device, and letting XAPI ask for xhci instead of ehci for high speed devices worked very well. Transfert speed for a mass storage device went from 15MB/s to 100MB/s.

I'm opening this issue so that we can discuss before submitting a design.

There's already code in XAPI that selects either USB1 (usb-bus) or USB2 (ehci), depending on device speed. It would be trivial to make XAPI select xhci when speed is above a certain threshold, but I'm no USB expert and I suspect maybe it's not that simple. However, QEMU doc says xhci can handle all cases, so maybe we should always use xhci.

Comes also the topic of the transition for existing VMs. I suppose changing the emulation type will change the devices exposed to the VM, so we probably can't change it for existing VMs without letting users explicitly select it?

A possible way forward:

  • Select xhci by default for high speed devices from now on, for new VMs.
  • Allow users to change the setting via XAPI calls: back to ehci in case there's an issue, or forward to xhci for existing VMs for which they need the performance boost.
  • Also allow users to set it when they add a vUSB to a VM.
  • At some point, consider using xhci by default whatever the speed?

We also need to evaluate the security aspects of xhci emulation in the current versions of QEMU in XenServer and XCP-ng, I suppose.

@gthvn1 could you link towards the related code and towards the QEMU doc that says xhci can handle all cases?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions