bhyve Not able to passthrough a USB 3.0 Host Controller

My guest VMs (either Windows or Linux) don't see the PCI USB host controller I am passing through bhyve().

In my system (motherboard: MSI MEG X570 Unify, processor: AMD Ryzen 9 5900X), I have this USB controller I want to passthrough to the VMs:
Bash:
# pciconf -lvc pci0:49:0:3
ppt0@pci0:49:0:3:       class=0x0c0330 rev=0x00 hdr=0x00 vendor=0x1022 device=0x149c subvendor=0x1462 subdevice=0x7c35
    vendor     = 'Advanced Micro Devices, Inc. [AMD]'
    device     = 'Matisse USB 3.0 Host Controller'
    class      = serial bus
    subclass   = USB
    cap 09[48] = vendor (length 8)
    cap 01[50] = powerspec 3  supports D0 D3  current D0
    cap 10[64] = PCI-Express 2 endpoint max data 256(256) FLR RO NS
                 max read 512
                 link x16(x16) speed 16.0(16.0) ASPM disabled(L0s/L1)
    cap 05[a0] = MSI supports 8 messages, 64 bit
    cap 11[c0] = MSI-X supports 8 messages
                 Table in map 0x10[0xfe000], PBA in map 0x10[0xff000]
    ecap 000b[100] = Vendor [1] ID 0001 Rev 1 Length 16
    ecap 0001[150] = AER 2 0 fatal 0 non-fatal 1 corrected
    ecap 000d[2a0] = ACS 1
    ecap 0017[370] = TPH Requester 1
Virtualization support is turned on in BIOS, here is the whole dmesg, and next the relevant parts:
Code:
...
  Features2=0x7ed8320b<SSE3,PCLMULQDQ,MON,SSSE3,FMA,CX16,SSE4.1,SSE4.2,MOVBE,POPCNT,AESNI,XSAVE,OSXSAVE,AVX,F16C,RDRAND>
...
AMD-Vi: IVRS Info VAsize = 64 PAsize = 48 GVAsize = 2 flags:0
...
amdiommu0 at device 0.2 on pci0
...
ivhd0: <AMD-Vi/IOMMU ivhd with EFR> on acpi0
ivhd0: Flag:b0<IotlbSup,Coherent>
ivhd0: Features(type:0x11) MsiNumPPR = 0 PNBanks= 2 PNCounters= 0
ivhd0: Extended features[31:0]:22294a5a<PPRSup,NXSup,GTSup,IASup> HATS = 0x2 GATS = 0x0 GLXSup = 0x1 SmiFSup = 0x1
SmiFRC = 0x2 GAMSup = 0x1 DualPortLogSup = 0x2 DualEventLogSup = 0x2
ivhd0: Extended features[62:32]:58f77ef<USSup> Max PASID: 0x2f DevTblSegSup = 0x3 MarcSup = 0x1
ivhd0: supported paging level:7, will use only: 4
ivhd0: device range: 0x0 - 0xffff
ivhd0: PCI cap 0x190b640f@0x40 feature:19<IOTLB,EFR,CapExt>
...
kldstat shows the vmm.ko module is loaded.
In /boot/loader.conf I have:
Code:
vmm_load="YES"
hw.vmm.amdvi.enable=1
pptdevs="49/0/3"
And here is how I fire up the Windows vm:
Code:
bhyve -DHPSw -c cores=4,threads=2 -m 8G \
        -s 0:0:0,amd_hostbridge \
        -s 0:2:0,ahci-hd,/dev/zvol/zroot/windisk0 \
        -s 0:3:0,virtio-net,tap0 \
        -s 0:4:0,hda,play=/dev/dsp6,rec=/dev/dsp6 \
        -s 0:5:0,virtio-rnd \
        -s 0:6:0,passthru,49/0/3 \
        -s 0:29:0,fbuf,tcp=0.0.0.0:5900,w=1920,h=1080,wait \
        -s 0:30:0,xhci,tablet \
        -s 0:31:0,lpc \
        -l com1,stdio \
        -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \
Windows
And the Linux vm (this is for testing, and it is easier for me to see if it picked up the PCI ports -lspci, than in Windows):
Code:
bhyve -AHS -c cores=4,threads=2 -m 8G \
        -s 0:0:0,amd_hostbridge \
        -s 0:2:0,virtio-blk,/dev/zvol/zroot/linuxdisk0 \
        -s 0:6:0,passthru,49/0/3 \
        -s 0:29:0,fbuf,tcp=0.0.0.0:5900,w=1920,h=1080,wait \
        -s 0:30:0,xhci,tablet \
        -s 0:31:0,lpc \
        -l com1,stdio \
        -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \
Linux
I don't know what could I be missing. Both VMs start fine, and they seem to work normally, without errors. Except that neither seem to pick up the PCI passthrough ports.
 
Is this controller on the motherboard or an external USB card you've installed in one of your PCI slots? FWIW I had problems passing an onboard USB controller, but I was able to successfully pass in a USB controller of a USB card plugged into one of my PCI slots.
 
It is a USB controller in the motherboard. Thanks for the info about the USB PCI card alternative.
 
Back
Top