USB device passthrough support on BHyVe
Short description: Support USB device passthrough on BHyVe, to make BHyVe more useful for users.
Project Title: USB device passthrough support on BHyVe
Name: Takuya ASADA
Languages (spoken and written): Japanese, English
I can spend 20-30 hours per week.
I also need to work on a research project in a university.
FreeBSD developer, Ph. D. student in Tokyo University of Technology.
I had worked at an embedded software company for 3 year, at that time I mainly worked on SMP and 64bit support for NetBSD based router firmware.
Using the knowledge gained, I become OpenBSD developer and contributed SMP support for OpenBSD/sgi port.
I gave presentation on AsiaBSDCon 2010 about the work:
I also working on OpenBSD porting project for Cavium OCTEON, which is MIPS architecture based multicore SoC for network appliance.
I've been researching Network I/O performance and parallelizing in university, writing small articles on my blog frequently:
Gave a presentation about modern Network I/O in Japan Vyatta User Group meeting:
Gave a presentation about Network I/O on virtualized enviroment in Internet Week 2011(The conference organized by JPNIC):
Participated GSoC 2011, implemented "Multiqueue BPF support" for FreeBSD:
Participated GSoC 2012, implemented "BHyVe BIOS emulation to boot legacy systems" for FreeBSD:
I become a FreeBSD src developer since last November, working on BHyVe hypervisor and FreeBSD network stack.
Current BHyVe implementation supports only few virtual devices: virtio-blk, virtio-net and UART.
It also able to using physical PCI device by PCI passthrough, but there're many PC which doesn't support IOMMU(It also called Intel VT-d or AMD-Vi, required for PCI passthrough).
This project adds support USB device passthrough on BHyVe.
USB device passthrough doesn't require IOMMU or any other special hardware features, it can support much more PCs than PCI passthrough.
USB is not faster than PCIe, but it has different varieties of devices, and much easier to install on host machine.
The project goal is to support USB 1.1/2.0 device passthrough on BHyVe.
* Implement UHCI emulator
Fork usr.sbin/bhyve/pci_uart.c to usr.sbin/bhyve/pci_uhci.c.
QEMU has MIT licensed UHCI emulation code, borrow these code and port it on pci_uhci.c.
Enable by -s option like: "-s 3:0,uhci,1" (configinfo = USB Bus ID).
* Port USB hub emulator
QEMU has MIT licensed USB hub emulation code, port it on usr.sbin/bhyve/usb_hub.c.
Enable by UHCI emulator as root hub.
* Implement USB device emulation framework
Referencing usr.sbin/bhyve/pci_emul.[ch], usr.sbin/bhyve/bhyverun.c and usr.sbin/bhyve/pci_*.c, implement USB device emulation framework.
- New argument on /usr/sbin/bhyve, to add USB device
We need "-s <slot,driver,configinfo>" style USB device argument on bhyverun.c.
Define it "-u <bus,device,driver,configinfo>".
Call usb_parse_dev() when -u assigned.
- Implement usb_parse_dev()
Fork usr.sbin/bhyve/pci_emul.[ch] to usr.sbin/bhyve/usb_emul.[ch].
Rename pci_parse_slot() to usb_parse_dev(), to handle -u argument.
Connect a device to root hub on specified USB host controller.
* Port host USB redirector
QEMU has MIT licensed host USB redirection code for *BSD, port in on usr.sbin/bhyve/usb_passthru.c.
It access ugen(4), talk with device directly on userland.
Enable by -u option like: "-u 1,1,passthru,ugen1.1" (configinfo = ugen(4) device name)
* Implement EHCI emulator
Fork pci_uhci.c, support EHCI features on it by referencing FreeBSD EHCI driver and EHCI specification.
Enable by -s option like: "-s 3:0,ehci,1" (configinfo = USB Bus ID).