# Problem applying a patch for vmm.ko



## Emrion (Feb 27, 2019)

I try to apply to a 12.0-RELEASE this patch. This is related to these threads:









						Bhyve crashes system during PCI passthrough
					

When I try to pass WiFi PCI device rtl8723be, the OS crashes and reboots. The guest boots normally when passthru is removed.  # bhyve -S -c 2 -m 1G -w -H \ -s 0,hostbridge -s 3,ahci-cd,/linux.iso \ -s 29,fbuf,tcp=0.0.0.0:5900,w=800,h=600,wait \ -s 30,xhci,tablet -s 31,lpc -l com1,stdio \ -s...




					forums.freebsd.org
				











						Bhyve crashes system during PCI passthrough
					

When I try to pass WiFi PCI device rtl8723be, the OS crashes and reboots. The guest boots normally when passthru is removed.  # bhyve -S -c 2 -m 1G -w -H \ -s 0,hostbridge -s 3,ahci-cd,/linux.iso \ -s 29,fbuf,tcp=0.0.0.0:5900,w=800,h=600,wait \ -s 30,xhci,tablet -s 31,lpc -l com1,stdio \ -s...




					forums.freebsd.org
				




So I apply the patch for /usr/src/sys/amd64/vmm/intel/vtd.c. Then I compile & install with `make && make install`. So far, so good.

First thing: the new vmm.ko is installed in /boot/modules/ not in /boot/kernel/ where lies its predecessor. Second thing: the size of the modules are very different for a so small patch:
Old vmm.ko:  416328 bytes.
New vmm.ko: 345384 bytes.

Last thing: I copied new vmm.ko in /boot/kernel, then I rebooted but the behaviour of bhyve remains inchanged: try to passthru a network card and get crash of the whole system a few time after the VM has started (with the same messages as reported in the  aforementioned threads).

Where is/are my mistake(s)?


----------



## Emrion (Feb 28, 2019)

As I suspected, to make things correctly, the entire kernel has to be compiled. Seems that it lacks an operation on certain kernel modules if you compile them separatly.

Alas, it didn't solve my problem and I realised that the road is long before to achieve my goal (run pfsense in bhyve).


----------

