opnsense-src/sys/modules/vmm
Mark Johnston b9ef152bec vmm: Merge vmm_dev.c
This file contains the vmm device file implementation.  Most of this
code is not machine-dependent and so shouldn't be duplicated this way.
Move most of it into a generic dev/vmm/vmm_dev.c.  This will make it
easier to introduce a cdev-based interface for VM creation, which in
turn makes it possible to implement support for running bhyve as an
unprivileged user.

Machine-dependent ioctls continue to be handled in machine-dependent
code.  To make the split a bit easier to handle, introduce a pair of
tables which define MI and MD ioctls.  Each table entry can set flags
which determine which locks need to be held in order to execute the
handler.  vmmdev_ioctl() now looks up the ioctl in one of the tables,
acquires locks and either handles the ioctl directly or calls
vmmdev_machdep_ioctl() to handle it.

No functional change intended.  There is a lot of churn in this change
but the underlying logic in the ioctl handlers is the same.  For now,
vmm_dev.h is still mostly separate, even though some parts could be
merged in principle.  This would involve changing include paths for
userspace, though.

Reviewed by:	corvink, jhb
Differential Revision:	https://reviews.freebsd.org/D46431
2024-08-26 18:41:39 +00:00
..
Makefile vmm: Merge vmm_dev.c 2024-08-26 18:41:39 +00:00