summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2020-05-26 17:32:17 +0000
committerAlyssa Ross <hi@alyssa.is>2020-05-29 18:56:36 +0000
commitfb12866ffe94dda9879d8879dee3043df2d60e7a (patch)
tree14f15baae8ac069ea08875c7cb7da35539fb79da
parent66beee3c6fcf0a9a98bdf2efc4bcc7bcc9ac6572 (diff)
downloaddoc-fb12866ffe94dda9879d8879dee3043df2d60e7a.tar
doc-fb12866ffe94dda9879d8879dee3043df2d60e7a.tar.gz
doc-fb12866ffe94dda9879d8879dee3043df2d60e7a.tar.bz2
doc-fb12866ffe94dda9879d8879dee3043df2d60e7a.tar.lz
doc-fb12866ffe94dda9879d8879dee3043df2d60e7a.tar.xz
doc-fb12866ffe94dda9879d8879dee3043df2d60e7a.tar.zst
doc-fb12866ffe94dda9879d8879dee3043df2d60e7a.zip
Document crosvm memfd server
Reviewed-by: impaqt <impaqt@vendek.net>
Reviewed-by: Cole Helbling <cole.e.helbling@outlook.com>
-rw-r--r--developer-manual.adoc25
1 files changed, 25 insertions, 0 deletions
diff --git a/developer-manual.adoc b/developer-manual.adoc
index a538437..b7eb2cb 100644
--- a/developer-manual.adoc
+++ b/developer-manual.adoc
@@ -194,6 +194,31 @@ compile the policy files into the crosvm binary so paths don't have to
 be hardcoded.
 
 
+==== The memfd server
+
+Spectrum's crosvm has been augmented with a feature called the "`memfd
+server`" (currently only on the
+https://spectrum-os.org/git/crosvm/log/?h=interguest[interguest]
+branch).  This is a small server that listens on a Unix stream socket.
+It receives a request consisting of a name and a size, uses those to
+allocate a
+https://man7.org/linux/man-pages/man2/memfd_create.2.html[memfd], and
+then sends the resulting memfd file descriptor back over the socket in
+response, along with a single byte status code.
+
+The purpose of this is that it can be exposed to the guest over
+virtio_wl.  This means that the guest can request and receive
+allocations of host memory.  This is important, because virtio_wl only
+allows file descriptors pointing to host memory to be sent over
+virtio_wl -- a memfd allocated in a guest cannot be sent over virtio_wl.
+It is rare that a guest needs to be able to allocate and send shared
+memory in this way, but it is important for a Wayland compositor
+running in a guest to be able to do this.
+
+The memfd server is disabled by default, but is enabled at startup
+with the `--wl-memfd` flag.
+
+
 === Sommelier
 
 https://chromium.googlesource.com/chromiumos/platform2/+/master/vm_tools/sommelier[Sommelier]