From b9ef152bec6cff4cd82b68921f631bd6efb24ae6 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Mon, 26 Aug 2024 18:41:39 +0000 Subject: 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 --- sys/modules/vmm/Makefile | 1 + 1 file changed, 1 insertion(+) (limited to 'sys/modules/vmm') diff --git a/sys/modules/vmm/Makefile b/sys/modules/vmm/Makefile index 92986a364883..47504a053c34 100644 --- a/sys/modules/vmm/Makefile +++ b/sys/modules/vmm/Makefile @@ -19,6 +19,7 @@ CFLAGS+= -I${SRCTOP}/sys/${MACHINE}/vmm/io SRCS+= vmm.c \ vmm_dev.c \ + vmm_dev_machdep.c \ vmm_instruction_emul.c \ vmm_stat.c -- cgit v1.3