On Sun, 5 Jun 2016, Marek Marczykowski-Górecki wrote:
> On Sat, Jun 04, 2016 at 06:13:45PM -0700, pixel fairy wrote:
>
> > Is it possible to have multiple usb qubes, one
> > for each controller?
>
> Yes, if you have multiple USB controllers. Which is quite rare
> nowadays...
At least for recent desktop motherboards, that seems slightly incorrect
statement according to my research. Few desktop PCH datasheets I've
looked, indicate that there are two USB controllers (EHCI and XHCI),
however, it seems that typically on a modern MB the ports are
forwarded/routed by default so that they appear under a single controller
due to ease of use reasons (also Linux device driver code forces
forwarding all ports which allow forwarding). XHCI PCI config has XUSB2PR
register that might allow disabling the forwarding for a selected set of
registers.
I'm yet to test if the forwarding/routing works for real because I lack
such a motherboard (I'll likely get one sooner than later though) but I
see no particular reason why it wouldn't work as documented. Probably
laptop PCH have similar arrangement and I might be able to test that one
soon if I find enough time to play with the usbvm kernel. Another thing
that needs testing, even if routing is configurable, is whether PCHs
really support EHCI and XHCI in different VMs or if there's some
other limiting depency between them.
I've attached potentially working patch for Linux kernel. The mapping
between PCI register ports might not be consistent though so that the
patch might not exactly do what intented as is (usb3/superspeed port
might unintentionally be routed to EHCI, the docs are unclear on this
point). However, if any USB port would successfully appear as EHCI one
when using a kernel with that patch in usb vm, it is great success in
itself on truly separating the ports.
At least X99/C612 and some recent Series X PCH datasheets listed the
required register (in case somebody is interested in testing this).
I suspect that for a secure implementation Xen would need to somehow
arbitrate that PCI register as otherwise the xhci usb VM might be able
to steal the usb ports from the ehci VM. But this is already way beyond
my current level of understanding about Xen and PCI passthrough.
--
i.