PSA when upgrading to 11.2 (VirtualBox kernel modules cause kernel panic on boot)

jrm@

Developer
Yesterday, I upgraded a system running 11.1-RELEASE to 11.2-RC1, but then hit a kernel panic during boot. The message on the screen disappeared so quickly that it was difficult to track down the cause. It turned out the problem was with VirtualBox kernel modules. The KBI is supposed to be stable between point releases, but apparently VirtualBox is special. Anyway, this caused me more time than I am willing to admit, so beware if you are running 11.2 and load VirtualBox kernel modules built on 11.1.
 
It turns out it's related to a KBI bug fix.
khng300 on IRC said:
Due to the changes introduced in https://svnweb.freebsd.org/base?view=revision&revision=328469 , the semantic in regards to vm_map_t.header.start/end is changed from valid range of vm map, to range outside of vm map. This results in breakage in x11/nvidia-driver, as the kmod currently in pkg.freebsd.org is built against 110101, and the semantic under the KBI become incompatible between FreeBSD 110101 and FreeBSD releng/11.2 . The introduction of vm_map_min/max/pmap_KBI only solves the problem for subsequent kmod built against 11.2 kernel after the change, when the kmod calls into vm_map_min, the starting high virtual address of the guard range is taken instead of the low virtual address of the guard range (which is originally the start of the valid virtual adress of the corresponding vm_map)
 
This is not specific to nvidia, but all X drivers I suspect. I am running intel via drm-next and have the same issue, the system will not boot with the vboxdrv module enabled.
 
I'm pretty sure the change affects almost all kernel modules that are from ports or packages. Kernel modules that are distributed with the base system are unaffected naturally because they are built with the matching kernel.
 
If anyone arrives from Google, per another post on this, the above post from kpa is correct for packages. In this case building the port fixes it. Theoretically since the current port version is 5.12.2 (I think?) you could fetch the kmod port matching that version from SVN and just build that. But the 5.12.2 kmod port is broken on 11.2-RELEASE, it failed to build for me.

So the fix as of today is to build both of them (emulators/virtualbox-ose and emulators/virtualbox-ose-kmod) from ports rather than using the packages.
 
The same type of issue affects the drm-*-kmod ports for the kms graphics drivers. Because the package builders use a jail based on 11.1 and these ports are marked as 11.2 and above only they are not built. So you have to build them yourself from the port.

11.1 is end of life soon and at that point I assume the jail on the package builders will be moved to 11.2. Then the vbox and drm packages should all work as expected on 11.2.
 
NVidia is another that has to be built from ports. There's a few, virtualbox and Nvidia being the ones that I ran into. (There's other mentions on this forum, don't know if it got gathered in one place. No mention, last time I looked, in UPDATING.)
 
Back
Top