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_H4,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 E2D1F1E9F4; Tue, 26 May 2020 17:37:40 +0000 (UTC) Received: from [127.0.1.1] (localhost [IPv6:::1]) by atuin.qyliss.net (Postfix) with ESMTP id 9F0671EA84; Tue, 26 May 2020 17:37:34 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 496) id 8A1D81E9C7; Tue, 26 May 2020 17:37:32 +0000 (UTC) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by atuin.qyliss.net (Postfix) with ESMTPS id 870961EA7E for ; Tue, 26 May 2020 17:37:28 +0000 (UTC) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 31B9F5C00B2 for ; Tue, 26 May 2020 13:37:27 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Tue, 26 May 2020 13:37:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alyssa.is; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=fm3; bh=eynCpSqtVNUTeJ3SCEw8Cx1O1e QjQz+faDKwrURaI2g=; b=QQ+Repb4tLC4JneeZgOyC77Ch6pMVDIN3tb/WA1Y89 rwHB5KPXE8ugBG/y0yoPjWesMXqLpso4qyFyvMXRZHmZj8xVz4tGD+53BRd3PNjz xQpUhrJ/EDUxSRt2fRuqSHtiTikQrCJD34HUzezn2/vSPz5/fW2bAAkC6utr6pxw ls/PR4Ld+h/Gjd2O042sO65eGNgXenO3lztK3r/TxYf4qbD/foKw9PaIKKDxZ9mC atL+IlXbrkz8i3x/U5zrNiDTFtgKt0grA9LO+J7mr506fBwAZw1YupFMcddaS9RG upR/D3jV9qWQ6GTCvIMwugseg74NCGiA+84r6+iK16FQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=eynCpSqtVNUTeJ3SC Ew8Cx1O1eQjQz+faDKwrURaI2g=; b=lQ0dyXJpLI634keUUVlceAC9/RqRqa4wx iVmiTkVq++BXYW+j2X65Vy39AVr4Y5tyAj/cuYQ5EsezXXNaOhBxxj7pTEqfPPfZ 5qHMKoWu/wQGwSmhfXZG3v/ARSz3RcAtnusYrPJi7eUJjlwtnFIxQ/VpElthrctD CA+gw0jVzK3T2Ijor33iXJjrgkzgpPEiiKQ+aBzmNnf03Dqfbn6ZcB+9mVtfPDkR qVcsO27U/UHG7wjo5NmILv1FmzNHBI86W76rYU5CP3Mm0O6m0j8JWHJiS2KgiA8c 0+2BtsYb08DlcwnBsbg2QMI60ez7tPmtZXbDmuz+xOkkn1RKMlX3A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedruddvvddguddufecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffoggfgsedtkeertd ertddtnecuhfhrohhmpeetlhihshhsrgcutfhoshhsuceohhhisegrlhihshhsrgdrihhs qeenucggtffrrghtthgvrhhnpeduueegfeeltdfgkeevgeeviedvueeigfduveegiedvtd eileefteeklefgudffhfenucffohhmrghinhepshhpvggtthhruhhmqdhoshdrohhrghdp mhgrnhejrdhorhhgpdhgohhoghhlvghsohhurhgtvgdrtghomhenucfkphepjeelrddvfe ehrdduudelrdduleegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghi lhhfrhhomhepqhihlhhishhsseigvddvtddrqhihlhhishhsrdhnvght 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 A8D0330665BD for ; Tue, 26 May 2020 13:37:26 -0400 (EDT) Received: by x220.qyliss.net (Postfix, from userid 1000) id 89B173D0; Tue, 26 May 2020 17:37:24 +0000 (UTC) From: Alyssa Ross To: devel@spectrum-os.org Subject: [PATCH doc] Document crosvm memfd server Date: Tue, 26 May 2020 17:37:09 +0000 Message-Id: <20200526173709.20503-1-hi@alyssa.is> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: F72UW5GIPTFYT5D4WVZXU5NTEETRJNPH X-Message-ID-Hash: F72UW5GIPTFYT5D4WVZXU5NTEETRJNPH 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 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: --- Looking for another set of eyes on this to check it makes sense to people who haven't dedicated several weeks of their life to thinking about it. ;) developer-manual.adoc | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/developer-manual.adoc b/developer-manual.adoc index a538437..5a5f80d 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 receives requests for 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 +time 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