Due to ABI difference (vboxdrv passes cpuset_t parameter (bitfield with CPU_SETSIZE -> MAXCPU bits) into smp_rendezvous_cpus()) kernel panics with "ncpus is 0 with non-zero map" message. Manual "opt_global.h" inclusion from current kernel build into src/VBox/Runtime/r0drv/freebsd/mp-r0drv-freebsd.c seems to fix this issue when MAXCPU is overridden; kern.smp.maxcpus may be used instead (in case if other 'global' options are not so problematic).
Feedback please!
I just started running 11.1-RELEASE on some of my systems and ran into this. At a minimum I think the driver should refuse to load if mp_maxcpus != MAXCPU. Is there a way to make a cpuset_t at runtime?
Created attachment 192427 [details] patch The attached patch adds a check and refuses to load vboxdrv when MAXCPU does not match mp_maxcpus.
(In reply to Craig Leres from comment #3) Thanks, can someone rebase for 6.1.46_1? (Assuming that the bug is still reproducible.)
Created attachment 244203 [details] updated patch Here's an updated patch. It's been nearly 4 years since I've run virtualbox anywhere so I did not go to the trouble of building a custom kernel with MAXCPU != 256 but I did build virtualbox-ose-kmod and test that vboxdrv still loads with the patch applied. Really the only reason I ran into this was that I had always bump'ed MAXCPU from its ridiculously low default in the before times and didn't notice when the default changed to the more modern value of 256. At that point I stopped customizing it.
(In reply to Craig Leres from comment #5) Thanks! Side note: <https://github.com/freebsd/freebsd-src/commit/9051987e40c5a1f2396c5ceecff119fb4da28160#diff-7a99811ebf6b6268a2581fcf050df0a2c325fdbf1c02481dad16afd38f4bd6a1> re: 1024.
Comment on attachment 244203 [details] updated patch Additional eyes on this patch. Whilst emulation@ is not the maintainer, it _is_ a specified address for problems; <https://github.com/freebsd/freebsd-ports/commit/afbf09cc33941f6e8015ea2a99665add0df3b03a#diff-64c4a683499abbf4275fc526621380d5ffa8c2f6c58cd5a2acf0080b6d47f377R17>