bhyve host crashes on VM start with USB passthru

Hello,

I’m running a FreeBSD 14.4-RELEASE server as a bhyve host for a Win11 VM. I want this VM to get access to a USB device. I’ve identified a USB port that seems alone up to the root XHCI device it depends on.
When passing-thru this device, and starting the VM, the host reboots. I’m using vm-bhyve.

I’ve identified the USB I target is seen as xhci0:
Code:
xhci0: <XHCI (generic) USB 3.0 controller> mem 0xfc000000-0xfc0fffff at device 0.3 on pci5
xhci0: 64 bytes context size, 64-bit DMA
usbus0 on xhci0
usbus0: 5.0Gbps Super Speed USB v3.0

and before configuring passthru in loader.conf I read:
Code:
# vm passthru|grep xhci0
xhci0      6/0/3        No           -

after configuring passthru in loader.conf I read:
Code:
# vm passthru|grep -E "xhci0|ppt"
ppt0       6/0/3        Yes          -
xhci0      6/0/4        No           -

usbus0 is still on xhci0, but xhci0 as jumped from pci0:6:0:3 to pci0:6:0:4 and pci0:6:0:3 is for ppt0 alone.
Not sure if it’s an expected result.

Any help greatly appreciated.

CPU is:
Code:
CPU: AMD Ryzen 7 7840U w/ Radeon  780M Graphics      (3294.03-MHz K8-class CPU)
  Origin="AuthenticAMD"  Id=0xa70f41  Family=0x19  Model=0x74  Stepping=1
  Features=0x178bfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,MMX,FXSR,SSE,SSE2,HTT>
  Features2=0x7ef8320b<SSE3,PCLMULQDQ,MON,SSSE3,FMA,CX16,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,AESNI,XSAVE,OSXSAVE,AVX,F16C,RDRAND>
  AMD Features=0x2e500800<SYSCALL,NX,MMX+,FFXSR,Page1GB,RDTSCP,LM>
  AMD Features2=0x75c237ff<LAHF,CMP,SVM,ExtAPIC,CR8,ABM,SSE4A,MAS,Prefetch,OSVW,IBS,SKINIT,WDT,TCE,Topology,PCXC,PNXC,DBE,PL2I,MWAITX,ADMSKX>
  Structured Extended Features=0xf1bf97a9<FSGSBASE,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,PQM,PQE,AVX512F,AVX512DQ,RDSEED,ADX,SMAP,AVX512IFMA,CLFLUSHOPT,CLWB,AVX512CD,SHA,AVX512BW,AVX512VL>
  Structured Extended Features2=0x405fde<AVX512VBMI,UMIP,PKU,OSPKE,AVX512VBMI2,GFNI,VAES,VPCLMULQDQ,AVX512VNNI,AVX512BITALG,AVX512VPOPCNTDQ,RDPID>
  Structured Extended Features3=0x10000010<FSRM,L1DFL>
  XSAVE Features=0xf<XSAVEOPT,XSAVEC,XINUSE,XSAVES>
  AMD Extended Feature Extensions ID EBX=0x791ef257<CLZERO,IRPerf,XSaveErPtr,RDPRU,BE,WBNOINVD,IBPB,INT_WBINVD,IBRS,STIBP,STIBP_ALWAYSON,PREFER_IBRS,SAMEMODE_IBRS,NOLMSLE,SSBD,CPPC,PSFD,BTC_NO,IBPB_RET>
  SVM: NP,NRIP,VClean,AFlush,DAssist,NAsids=32768
  TSC: P-state invariant, performance statistics

The output of sysctl hw.vmm.amdvi is:
Code:
hw.vmm.amdvi.domain_id: 0
hw.vmm.amdvi.disable_io_fault: 0
hw.vmm.amdvi.ptp_level: 4
hw.vmm.amdvi.host_ptp: 1
hw.vmm.amdvi.enable: 1
hw.vmm.amdvi.count: 1

/boot/loader.conf is:
Code:
kern.geom.label.disk_ident.enable="0"
kern.geom.label.gptid.enable="0"
kern.racct.enable="1"

vmm_load="YES"
cryptodev_load="YES"
zfs_load="YES"

amdtemp_load="YES"
autoboot_delay="2"

accf_data_load="YES"
accf_http_load="YES"

mac_portacl_load="YES"
cpuctl_load="YES"

#passthrough
hw.vmm.amdvi.enable=1
pptdevs="6/0/3"

# https://m4c.pl/blog/freebsd-audio-setup-bitperfect-equalizer-realtime/#freebsd_equalizer
hint.pcm.4.eq=1

VM config file is:
Code:
loader="uefi"
graphics="yes"
graphics_port="5799"
xhci_mouse="yes"
cpu=2
memory=2G

passthru0="6/0/3"

# put up to 8 disks on a single ahci controller.
# without this, adding a disk pushes the following network devices onto higher slot numbers,
# which causes windows to see them as a new interface
ahci_device_limit="8"

# ideally this should be changed to virtio-net and drivers installed in the guest
# e1000 works out-of-the-box
network0_type="e1000"
network0_switch="noinet"

disk0_type="ahci-hd"
disk0_name="disk0.img"

# windows expects the host to expose localtime by default, not UTC
utctime="no"
uuid="8898e0f0-9a3d-11f1-9289-d063b40622a6"
network0_mac="58:9c:fc:01:6e:51"
 
Back
Top