From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.3 (2019-12-06) on atuin X-Spam-Level: X-Spam-Status: No, score=-1.2 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.3 Received: by atuin.qyliss.net (Postfix, from userid 496) id 4C1D92037A; Wed, 27 May 2020 23:27:35 +0000 (UTC) Received: from [127.0.1.1] (localhost [IPv6:::1]) by atuin.qyliss.net (Postfix) with ESMTP id 88B0E203D5; Wed, 27 May 2020 23:27:29 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 496) id ABB09203C6; Wed, 27 May 2020 23:27:27 +0000 (UTC) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by atuin.qyliss.net (Postfix) with ESMTPS id 0E47E203C5 for ; Wed, 27 May 2020 23:27:24 +0000 (UTC) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 800205C012D; Wed, 27 May 2020 19:27:23 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Wed, 27 May 2020 19:27:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alyssa.is; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=BEFXA7CLQH93e to7cwEfraF6dE8RCxrRKohoUaaA4dQ=; b=JsfmRPTtaI3qQcdkO87FoZCvBsaOD VUKTySBeLvhZ5JGzynQ4d5rHthf9HI/0d0QXpXgAWq/yQPy7Bp8enZURA90uYClq ygtC0SZdSUUJdySRcjm3B9K+6OGP/fT9JwyamW8hmXM4eNZhEoystg4r2HYCith+ w6vXMOiergZlIGoceNoX9EECXlEz+xf9bAGvh9DTIOeKL30WBNUe019aNNmiO1P4 5cUCmALR4y0BsNjuB7jXIblLsNPwni0TmkjuiMJPCFd4w9tFaWVRW2o6IuCxnGxl oW9sRdRdxq6Rt/y6JzV1pYQuf0pwq5+gPGNP3tIkxxpoMvIEL45BTBY4A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=BEFXA7CLQH93eto7cwEfraF6dE8RCxrRKohoUaaA4dQ=; b=xFOGd8kN FC+QrkV7dsaq1fkwsBdp3iZzGwGGnIMQuXRZ/rq7RHu7vvscyuZsCrcT/AyTYdRh 3mQeQw7uc62leypdNcxFZ9UfQtvGsvgRINbdspir8ZJKtJnfqltvZltqdbDxN7Hm qJZY2SjARRaSKmXNde8be6vfURhJjv9kEoEGbpSSbH8OIeaC7ML/WwSzHJyAO3/J wxjR7x/WyuSjjL16oc6qzf6sjg1sVV/kQ2TaJowHicRZ5JHt13zVXT/Y2er6Xf1F Lg8oYil9zNR9YG6KRkToAzxctey0qPYuVVQNwVVudaxqTLzkPy3nUPM9GNpQwrxW cCbDSecyNJJyKQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedruddvhedgudelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeetlhihshhs rgcutfhoshhsuceohhhisegrlhihshhsrgdrihhsqeenucggtffrrghtthgvrhhnpedtie efkedtheelveduheevkeehfffguddvjeekfeevudeiveehhedtfffhveeileenucffohhm rghinhepshhpvggtthhruhhmqdhoshdrohhrghdpmhgrnhejrdhorhhgpdhgohhoghhlvg hsohhurhgtvgdrtghomhenucfkphepjeelrddvfeehrdduudelrdduleegnecuvehluhhs thgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepqhihlhhishhsseigvd dvtddrqhihlhhishhsrdhnvght X-ME-Proxy: Received: from x220.qyliss.net (p4feb77c2.dip0.t-ipconnect.de [79.235.119.194]) by mail.messagingengine.com (Postfix) with ESMTPA id 631003060FE7; Wed, 27 May 2020 19:27:22 -0400 (EDT) Received: by x220.qyliss.net (Postfix, from userid 1000) id 88064403; Wed, 27 May 2020 23:27:22 +0000 (UTC) From: Alyssa Ross To: devel@spectrum-os.org Subject: [PATCH doc v2] Document crosvm memfd server Date: Wed, 27 May 2020 23:27:09 +0000 Message-Id: <20200527232709.22211-1-hi@alyssa.is> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200526173709.20503-1-hi@alyssa.is> References: <20200526173709.20503-1-hi@alyssa.is> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: LCFPP3VLR54NUQ7C27U56EQ47MDV7ZZH X-Message-ID-Hash: LCFPP3VLR54NUQ7C27U56EQ47MDV7ZZH X-MailFrom: qyliss@x220.qyliss.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: Alyssa Ross , impaqt , Cole Helbling X-Mailman-Version: 3.3.0 Precedence: list List-Id: Patches and low-level development discussion Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: --- Thanks for the comments. Should be addressed now. Please take a(nother) look. If you think it looks good, I'd appreciate a Reviewed-by tag from you. :) (Last bit is just something nice for me to put in the git log, e.g. Reviewed-by: Alyssa Ross , and means that you had a look and don't see anything wrong with the changes. By convention those should be sent by the reviewer rather than just made up by me. :)) developer-manual.adoc | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/developer-manual.adoc b/developer-manual.adoc index a538437..d69707d 100644 --- a/developer-manual.adoc +++ b/developer-manual.adoc @@ -194,6 +194,31 @@ compile the policy files into the crosvm binary so p= aths don't have to be hardcoded. =20 =20 +=3D=3D=3D=3D 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=3Dinterguest[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. + + =3D=3D=3D Sommelier =20 https://chromium.googlesource.com/chromiumos/platform2/+/master/vm_tools= /sommelier[Sommelier] --=20 2.26.2