summaryrefslogtreecommitdiff
path: root/sbin/clri
diff options
context:
space:
mode:
authorDave Voutila <dv@cvs.openbsd.org>2023-05-13 23:15:29 +0000
committerDave Voutila <dv@cvs.openbsd.org>2023-05-13 23:15:29 +0000
commit0450f77e1971ab09e8861ab1cab51909d3e1adbb (patch)
tree54405ab1af285f1b5301105e31cc0e9c675cda5d /sbin/clri
parent7698cea1a4c2fa7eff4cc2405547ca04b294213b (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