On 2019-11-09 19:45, Marek Marczykowski-Górecki wrote:
> On Sat, Nov 09, 2019 at 07:18:40PM -0500, Demi M. Obenour wrote:
>> I was trying to use adb with QubesOS’s USB passthrough, and I was
>> not able to get it to work.
> 
> From what I remember from my experiments with adb and qvm-usb, USBIP
> don't pass through device reset requests. And even when device is reset
> externally, qvm-usb won't assign it back automatically. The later thing
> may be actually a good thing, to prevent device suddenly changing its
> identification - like you think you attach some harmless device, but it
> switches to some exotic device with a known bug in its driver. But it
> breaks this use case.
> 
>> According to a post on LKML, the USBIP driver (used by QubesOS
>> USB passthrough) and libusb are not meant to work together.
>> One alternative would be to use qemu in the stubdomain to present an
>> emulated PCI USB device, instead of requiring USBIP support in the
>> guest kernel.  This would also allow USB passthrough to work to VMs
>> that do not support USBIP, or indeed even qrexec.
> 
> This is interesting idea and indeed something we consider for non-Linux
> VMs. It won't help you for PVH domains though, as there is no qemu
> involved. Anyway, we'd be very welcome in a contributed patches in this
> area.

I would love to send them, but right now I am rather short on time.
I still have the socket-based qrexec patch to finish first.

> 
>> Right now, I plan on using adb in sys-usb itself, after blacklisting
>> drivers for USB devices not in use.  There ought to be a better way.
>> IMO, sys-usb should *only* support USBIP, with the real protocol
>> handling done in other domains, and the resulting devices (be they
>> block devices or others) attached to yet other domains.
> 
> Given performance and complexity of USB vs block protocols, IMO handling
> mass-storage directly in sys-usb and connecting it further as block
> device is a better idea. But otherwise I agree.
> 
> Also, disposable sys-usb is a good idea when you use more complex
> devices directly in sys-usb:
> https://www.qubes-os.org/doc/disposablevm-customization/#using-static-disposablevms-for-sys-
> 
> Using intermediate DisposableVM for "unpacking" USB protocol to
> something simpler would work in a principle, but has two major usability
> issues:
>  - DisposableVM (or more specifically: Linux VM) takes some precious
>    memory
>  - USBIP is slow

That is a very good point.  Both would be averted if we ran on a
microkernel, such as seL4, and had drivers that ran directly on the
microkernel.  Alas, we are stuck with Xen and Linux for the time being.

Sincerely,

Demi

-- 
You received this message because you are subscribed to the Google Groups 
"qubes-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qubes-devel/2e7d9b97-1795-9eda-cc2d-5737609052d7%40gmail.com.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to