diff options
author | Dave Voutila <dv@cvs.openbsd.org> | 2023-05-13 23:15:29 +0000 |
---|---|---|
committer | Dave Voutila <dv@cvs.openbsd.org> | 2023-05-13 23:15:29 +0000 |
commit | 0450f77e1971ab09e8861ab1cab51909d3e1adbb (patch) | |
tree | 54405ab1af285f1b5301105e31cc0e9c675cda5d /sbin/clri | |
parent | 7698cea1a4c2fa7eff4cc2405547ca04b294213b (diff) |
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@
Diffstat (limited to 'sbin/clri')
0 files changed, 0 insertions, 0 deletions