From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from atuin.qyliss.net (localhost [IPv6:::1]) by atuin.qyliss.net (Postfix) with ESMTP id E898A56A69; Fri, 21 Jul 2023 18:00:30 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id 316FE56AD0; Fri, 21 Jul 2023 18:00:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on atuin.qyliss.net X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) by atuin.qyliss.net (Postfix) with ESMTPS id 9C07356A63 for ; Fri, 21 Jul 2023 18:00:25 +0000 (UTC) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 3A3003200985 for ; Fri, 21 Jul 2023 14:00:23 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 21 Jul 2023 14:00:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alyssa.is; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to; s=fm2; t=1689962422; x=1690048822; bh=60 mzO3eaqfeKs1v6+cgGOezI68XBIHSH2kUSWKvaowc=; b=H0+aS3GaVMKuaL0z5X OSDLgMCkqvX6ox6/RyBPcI3xuVUVKMLEsoRigeucUL0+FviNEk1VuuZbYMEmy4AR yiLsA16NWJasOgMzZIzezZDEfJ4ZiilhIGiVWCfzgJ2udV5H5pvbwOsgGisxbqxr gnHLruPP2yuu/L5sHmy6YDXnmF0W6aFEQaw8ntmH+90UwVV9J1mOzWphCjETEhIZ zTzGoh2l9YtcR59g3nI/cFG2dLFcnh0XLJhSy3ZZ165KoLZmGUnJ7lSCapl/szrU T3Y9/0772L/lsVMubhtQdcl6b9qYBS840JQjJZgwi7RcbTg/+m7tmv0sY9s+Hz7F hRBg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1689962422; x=1690048822; bh=60mzO3eaqfeKs 1v6+cgGOezI68XBIHSH2kUSWKvaowc=; b=mo2HOTY67zIryNOhc3B1RLgYKKZ3J ZBejp0Q1i2qAWmXDMR0/djs++YnpRwmXzDvqDTmoI7XtJENj7WWgaS2IxLXTqYBK dW2d8R7aszmt7L+LaDmErbO0xMRowUlWoHx6L9AIGek/SwiZYfFOk3zAAQjVdazl lIWm4v2NEdRcuDDA1t61yV7EHZ0tYNeocLiRUjcd7f7SA+QkIzg2/l0+sBgt2c4m DWrBsZ0mmh5jnSTMiQS49KL6PGBH91bHFqHeb9JsSZ/CtZoeTUw1sHN6rD3He4Jw yp/kN+15MahDojx/gCa/CGQIb2Ewew/tC7vgBXHRCmElD8XYraeqQvlaw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrhedvgdduudehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofggtgfgsehtkeertd ertdernecuhfhrohhmpeetlhihshhsrgcutfhoshhsuceohhhisegrlhihshhsrgdrihhs qeenucggtffrrghtthgvrhhnpefhffekgefhiefhvefgtedtgfejtdffteeltdfhfffhfe ehkeefieevvddtveekgeenucffohhmrghinhepshhpvggtthhruhhmqdhoshdrohhrghdp ghhoohhglhgvshhouhhrtggvrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomhephhhisegrlhihshhsrgdrihhs X-ME-Proxy: Feedback-ID: i12284293:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Fri, 21 Jul 2023 14:00:22 -0400 (EDT) Received: by x220.qyliss.net (Postfix, from userid 1000) id 9545A7325; Fri, 21 Jul 2023 18:00:20 +0000 (UTC) From: Alyssa Ross To: devel@spectrum-os.org Subject: [PATCH v3 0/6] Initial support for VM Wayland Date: Fri, 21 Jul 2023 18:00:09 +0000 Message-Id: <20230721180015.597099-1-hi@alyssa.is> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Type: text/plain; charset=true Content-Transfer-Encoding: 8bit Message-ID-Hash: BCXJ3JE7DK4SHDP37EMCMLWLDMCEPCYG X-Message-ID-Hash: BCXJ3JE7DK4SHDP37EMCMLWLDMCEPCYG X-MailFrom: hi@alyssa.is X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-devel.spectrum-os.org-0; header-match-devel.spectrum-os.org-1; header-match-devel.spectrum-os.org-2; header-match-devel.spectrum-os.org-3; header-match-devel.spectrum-os.org-4; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.5 Precedence: list List-Id: Patches and low-level development discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Changes since v2: - Disable virgl for virtio-gpu devices - Ensure wayland-proxy-virtwl isn't started before card0 appears - Build everything with musl - Support testing netvm with crosvm in addition to appvms v1: https://spectrum-os.org/lists/archives/spectrum-devel/20220928170128.1583791-1-alyssa.ross@unikie.com v2: https://spectrum-os.org/lists/archives/spectrum-devel/20220930213533.1710618-1-alyssa.ross@unikie.com This series adds the Spectrum-side support for running VMs that can display Wayland windows on the host compositor, using virtio-gpu. There are various small things still to be resolved, but it's ready for other people to try out and test. The easiest way to test this out is to run "vm-start hello-wayland" on the Spectrum host. If everything goes well, a small window with a picture of a cat (hello-wayland) should appear. This window is running in a VM. Currently, Wayland clients more complex than hello-wayland are unlikely to work, due to a couple of upstream bugs: - https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4584252 - https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4684048 With those two fixes applied, I've been able to run much more complex applications, e.g. Krita. But I don't want to keep this waiting any longer, so let's get the basics in, and not block on fixing the remaining upstream problems. This has felt so close for so long, so I'm not going to miss this opportunity. As for what took this so long, mostly it's been stuff that isn't part of this series. Fixing crosvm, refining my cloud-hypervisor vhost-user-gpu implementation, etc. The previous submissions of this series were marked as RFC because there were bits I just wasn't quite happy enough with to merge them at the time — having to use Glibc for certain components, having virgl always enabled, etc. Those things have all been resolved. Alyssa Ross (6): img/app: allow waiting for GPU to appear vm-lib: add mesa drivers to VM img/app: add support for testing virtio-gpu vm: add support for testing in crosvm host: add support for Wayland in VMs vm/app: add hello-wayland demo VM .../using-spectrum/creating-vms.adoc | 5 ++++ host/initramfs/extfs.nix | 4 ++- host/rootfs/Makefile | 4 +++ host/rootfs/default.nix | 6 ++-- host/rootfs/etc/s6-rc/ext-rc-init/up | 7 +++++ host/rootfs/etc/template/gpu/data/check | 5 ++++ host/rootfs/etc/template/gpu/notification-fd | 1 + .../etc/template/gpu/notification-fd.license | 2 ++ host/rootfs/etc/template/gpu/run | 9 ++++++ host/rootfs/etc/template/gpu/type | 1 + host/rootfs/etc/template/gpu/type.license | 2 ++ host/start-vm/lib.rs | 10 +++++++ img/app/Makefile | 25 +++++++++++++++- img/app/etc/mdev.conf | 3 +- img/app/shell.nix | 2 +- lib/common.mk | 3 ++ vm-lib/make-vm.nix | 12 ++++++-- vm/app/hello-wayland.nix | 29 +++++++++++++++++++ vm/sys/net/Makefile | 11 +++++++ vm/sys/net/shell.nix | 2 +- 20 files changed, 133 insertions(+), 10 deletions(-) create mode 100755 host/rootfs/etc/template/gpu/data/check create mode 100644 host/rootfs/etc/template/gpu/notification-fd create mode 100644 host/rootfs/etc/template/gpu/notification-fd.license create mode 100755 host/rootfs/etc/template/gpu/run create mode 100644 host/rootfs/etc/template/gpu/type create mode 100644 host/rootfs/etc/template/gpu/type.license create mode 100644 vm/app/hello-wayland.nix base-commit: 13bb6394205346d161fa6f1467b7c6ba81196fb0 -- 2.40.1