History log of /openbsd-current/sys/dev/vmm/vmm.h
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.4 11-Jan-2024 jan

fix build with VMM_DEBUG option

ok dv@


Revision tags: OPENBSD_7_4_BASE
# 1.3 13-May-2023 dv

vmm(4)/vmd(8): switch to anonymous shared mappings.

While splitting out emulated virtio network and block devices into
separate processes, I originally used named mappings via shm_mkstemp(3).
While this functionally achieved the desired result, it had two
unintended consequences:

1) tearing down a vm process and its child processes required
excessive locking as the guest memory was tied into the VFS layer.

2) it was observed by mlarkin@ that actions in other parts of the
VFS layer could cause some of the guest memory to flush to storage,
possibly filling /tmp.

This commit adds a new vmm(4) ioctl dedicated to allowing a process
request the kernel share a mapping of guest memory into its own vm
space. This requires an open fd to /dev/vmm (requiring root) and
both the "vmm" and "proc" pledge(2) promises. In addition, the caller
must know enough about the original memory ranges to reconstruct them
to make the vm's ranges.

Tested with help from Mischa Peters.

ok mlarkin@


# 1.2 26-Apr-2023 mlarkin

Reodrer some things to fix vmctl/vmd builds after the vmm MI/MD split


# 1.1 26-Apr-2023 mlarkin

Refactor MD/MI parts of vmm.

ok dv, deraadt


# 1.3 13-May-2023 dv

vmm(4)/vmd(8): switch to anonymous shared mappings.

While splitting out emulated virtio network and block devices into
separate processes, I originally used named mappings via shm_mkstemp(3).
While this functionally achieved the desired result, it had two
unintended consequences:

1) tearing down a vm process and its child processes required
excessive locking as the guest memory was tied into the VFS layer.

2) it was observed by mlarkin@ that actions in other parts of the
VFS layer could cause some of the guest memory to flush to storage,
possibly filling /tmp.

This commit adds a new vmm(4) ioctl dedicated to allowing a process
request the kernel share a mapping of guest memory into its own vm
space. This requires an open fd to /dev/vmm (requiring root) and
both the "vmm" and "proc" pledge(2) promises. In addition, the caller
must know enough about the original memory ranges to reconstruct them
to make the vm's ranges.

Tested with help from Mischa Peters.

ok mlarkin@


# 1.2 26-Apr-2023 mlarkin

Reodrer some things to fix vmctl/vmd builds after the vmm MI/MD split


# 1.1 26-Apr-2023 mlarkin

Refactor MD/MI parts of vmm.

ok dv, deraadt