pci passthrough bhyve usb xhci

I just wanted to say "thank you". I had this problem with 3 different boards and wanted to use PCI Passthrough with a NIC which always ended in a panic situation (doesn't matter what Interface I entered in pptdevs).

This patch also works properly with an actual FreeBSD 12.0-CURRENT. The actual CPU I use is a i7-7700. I had the issue also with older generations.
 
I've applied the patch to release 11.2 and everything works now. I'll let you know if I got any stability issues.
 
I have a problem with PCI passthrough with OpenBSD and NetBSD guests. FreeBSD and Linux guests work without a problem.
My CPU is a E3-1220 v5 with the C236 chipset, just as reported by others in this thread.
I have the same problem running bhyve with both 11.1-Release and 11.2-Release on the host (hypervisor).

The NIC that I do passthrough with, will not work and dmesg shows this:
Code:
wm0 at pci0 dev 5 function 0: 82576 quad-1000BaseT Ethernet (rev. 0x01)
pci_intr_map: no mapping for pin B (line=ff)
wm0: unable to map interrupt
bge0 at pci0 dev 6 function 0: Broadcom BCM5720 Gigabit Ethernet
pci_intr_map: no mapping for pin B (line=ff)
bge0: couldn't map interrupt

Note that I have tried with two different NICs.
The hardware works fine booting OpenBSD without bhyve.

Is this a related or the same problem as discussed in this thread?
The server is a production server so I would not want to divert from Release.
 
Contradiction
No it's not. Maybe I was a bit unclear so I edited my post to clarify.

I discovered the problem running 11.1-Release on my server, running bhyve with a FreeBSD and a OpenBSD guest.
PCI passthrough on the virtual FreeBSD worked. PCI passthrough on the virtual OpenBSD did not work.
I have since upgraded to 11.2-Release on the hardware and tried with a virtual CentOS and virtual NetBSD.
CentOS works. NetBSD does not work.
 
Is this a related or the same problem as discussed in this thread?

Potentially, but the symptoms seem different so I wouldn't get your hopes up. You can try using the patch from:

Simple procedure for building and installing patched vmm module:
cd /usr/src/sys/amd64/vmm/intel
fetch "https://bugs.freebsd.org/bugzilla/attachment.cgi?id=195225" -o vmm.patch
patch < ./vmm.patch
cd /usr/src/sys/modules/vmm
make
make install clean
mv /boot/kernel/vmm.ko /boot/kernel/vmm_unpatched.ko
 
Up until today haven't had one crash and everything functions fine. Well it only crashed once but that was due to the fact that i accidentally had passed through the PCI device to 2 machines.
 
Try to upgrade from 11.0-RELEASE to 12.0-RELEASE to resolve the same issue, unlucky until apply this patch.
My CPU is 3215U and it make pfsense runing faster on bhyve.
Appreciate!!!
 
OK, so far haven't applied the patch, the results are different but still negative: system doesn't freeze, but bhyve (Win 10 guest) crashes shortly after start. Will see now if the patch helps that issue.
I'm also trying the xhci passthrough following the same idea. So, pptdevs work fine, pciconf -vl | grep ppt:
Code:
ppt0@pci0:6:0:0:        class=0x0c0330 card=0x34831106 chip=0x34831106 rev=0x01 hdr=0x00
ppt1@pci0:7:0:0:        class=0x020000 card=0x012310ec chip=0x816810ec rev=0x0c hdr=0x00
But bhyve starts, I get connected showing Win 10 booting for a short while, then crashes:
Code:
Assertion failed: (error == 0), function modify_bar_registration, file /usr/src/usr.sbin/bhyve/pci_emul.c, line 504.
 
OK, so far haven't applied the patch, the results are different but still negative: system doesn't freeze, but bhyve (Win 10 guest) crashes shortly after start. Will see now if the patch helps that issue.
I'm also trying the xhci passthrough following the same idea. So, pptdevs work fine, pciconf -vl | grep ppt:
Code:
ppt0@pci0:6:0:0:        class=0x0c0330 card=0x34831106 chip=0x34831106 rev=0x01 hdr=0x00
ppt1@pci0:7:0:0:        class=0x020000 card=0x012310ec chip=0x816810ec rev=0x0c hdr=0x00
But bhyve starts, I get connected showing Win 10 booting for a short while, then crashes:
Code:
Assertion failed: (error == 0), function modify_bar_registration, file /usr/src/usr.sbin/bhyve/pci_emul.c, line 504.
EDIT: Oops, this seems to be a different issue. This happens to a card with multiple bars, it seems.
 
EDIT: Oops, this seems to be a different issue. This happens to a card with multiple bars, it seems.
Yes, this is a different issue, unrelated to the one with freezing -- that one I evidently don't have.
But this one is bhyve shutting down when passing through a PCI card with multiple bars (read the link above). The patch provided in that thread at freebsd-virtualization mailing list works fine, but has not yet been committed.
I'm not sure if this should be put in a separate thread, but it looks like worth it.
 
I see this is an old thread and the problem was solved in later versions of FreeBSD, but I am stuck with version 12.3-STABLE and really need to find a solution. Is there a workaround for this?
 
but I am stuck with version 12.3-STABLE
Update your 12-STABLE. Why do you think you're "stuck" with 12.3-STABLE?

Note that the ENTIRE 12 branch will be End-of-Life at the end of this year. So you should probably investigate an upgrade path to 13.x.
 
Back
Top