From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on atuin.qyliss.net X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.6 Received: from atuin.qyliss.net (localhost [IPv6:::1]) by atuin.qyliss.net (Postfix) with ESMTP id 7036D7257D; Fri, 30 Sep 2022 21:35:52 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 496) id 95C6E72579; Fri, 30 Sep 2022 21:35:49 +0000 (UTC) Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by atuin.qyliss.net (Postfix) with ESMTPS id 99AC672578 for ; Fri, 30 Sep 2022 21:35:47 +0000 (UTC) Received: by mail-ej1-x62c.google.com with SMTP id r18so11590149eja.11 for ; Fri, 30 Sep 2022 14:35:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unikie.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=Uswi3E6g3uA0F9GBvleEbyggPasK+ngWx/604AEHgg0=; b=MRLhbqcSj/nF/vl9iQ7ZJy0fCjqkZ0KIVxYou+6cqcExbZJpq33u9yB2mYr7VX1l6C NU+RXTPfgZhbcpmXPHVQslnOgNpIsWJXcywHEjvD/A2t/xn2s2IIfDMNOrwpL+aFmvlJ UNTVFRSXjfxbOgMxjG6iH+ig9iEw/1Hrzgs4q0KRzwcbQV10GinrA233fsG9DOgzOITI yxpCUI7Z2dJuEofkYuPr3C6b1k93A/NK10A0GiBTBwZsevFbazOUYSjlxur2hnwACX7H 7mogOZ6ZeU2uG58zhzxyw++kDlvscaKF5YpSkKRTY//DamuS/2cYbxsQJmjOzesLd9zQ m0Ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=Uswi3E6g3uA0F9GBvleEbyggPasK+ngWx/604AEHgg0=; b=RsYkwVsQ0kq/P/JNaSZYmsp7gW4DdGaOx1NTC4LZeMJhLa+sd/34cLRRqYg2SZg9il AYu+SAT8/5wPKkdwUuOnvMkDbpBZUZSYh+tpF/7BwPCZQcZJJlK7CkYAPEzYQLhQAhfU o6rC3HBEKenXTW58WHCnvQRuOLMCE4r6CPjwXQpxHDomuhI6IulxxG1fLYXVWGPLOO8Z TzcFk3lyPNoS836K7bi9/LeFHvP8NazMbcamNjiqUwnPOJCH38S2BSliyKKgc7KZVa7y UA+jLwczdxfuVc7BCO9DpM2kcQG1+rdwIZgvyICNQMRM/kQ5ksHMLWyTC1zjJweeJz66 zzYQ== X-Gm-Message-State: ACrzQf2pEL7TYNpWQNu3Y9ys8VaselcCCU4oWLEByU0MdSiBCnQt2Xw2 80kuzjID2OWJ0AbaaKxgk/OD2eGMlj0gamDs X-Google-Smtp-Source: AMsMyM4ta5Pb3EybvJvznp5ksCVsYxpcSbbXR5Vhetun1q6W+kEeWo/KTcK7r4S3reNrFXPZqGa+sA== X-Received: by 2002:a17:907:78a:b0:782:2223:a7cd with SMTP id xd10-20020a170907078a00b007822223a7cdmr7618356ejb.532.1664573747254; Fri, 30 Sep 2022 14:35:47 -0700 (PDT) Received: from x220.qyliss.net (p54b8e692.dip0.t-ipconnect.de. [84.184.230.146]) by smtp.gmail.com with ESMTPSA id ia14-20020a170907a06e00b007778c9b7629sm1732308ejc.34.2022.09.30.14.35.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Sep 2022 14:35:46 -0700 (PDT) Received: by x220.qyliss.net (Postfix, from userid 1000) id 2510F56B; Fri, 30 Sep 2022 21:35:46 +0000 (UTC) From: Alyssa Ross To: devel@spectrum-os.org Subject: [RFC PATCH v2 00/10] Initial support for VM Wayland Date: Fri, 30 Sep 2022 21:35:23 +0000 Message-Id: <20220930213533.1710618-1-alyssa.ross@unikie.com> X-Mailer: git-send-email 2.37.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: 6HPJ3Q2PISEX4XVMVTCEHGLF63DWZSVU X-Message-ID-Hash: 6HPJ3Q2PISEX4XVMVTCEHGLF63DWZSVU X-MailFrom: alyssa.ross@unikie.com X-Mailman-Rule-Hits: header-match-devel.spectrum-os.org-0 X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1 CC: Puck Meerburg , Ville Ilvonen 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: IMPORTANT NOTE: this series should be applied on top of my previous series "Introduce a shared base for application VMs" [1]. This is a bit inconvenient I know, but I haven't committed the other series yet due to wanting to take a second pass at it. Changes since v1: - Fix syntax in img/app development Makefile target. - Enable virgl for virtio-gpu devices (see below). v1: https://spectrum-os.org/lists/archives/spectrum-devel/20220928170128.1583791-1-alyssa.ross@unikie.com/ Introduction ------------ 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, virgl is enabled for all virtio-gpu devices. This means that all VMs will have GPU acceleration enabled. This is currently required to work around what appears to be a kernel bug that causes applications to freeze, but is likely not something we want to be enabling by default once that's fixed. I have tested with hello-wayland, as in the appvm provided as a demonstration here, and also with foot (by replacing hello-wayland with foot in that VM). I haven't done enough testing with this version of the code to guage how reliably they work yet. [1]: https://spectrum-os.org/lists/archives/spectrum-devel/20220919073659.1703271-1-hi@alyssa.is/ [2]: https://spectrum-os.org/lists/archives/spectrum-devel/20220928170128.1583791-1-alyssa.ross@unikie.com/ Alyssa Ross (10): host/start-vm: use MAP_SHARED memory for VMs img/app: don't block app startup on network online img/app: add Wayland over virtio-gpu support to kernel vm-lib: add mesa drivers to VM img/app: add support for testing virtio-gpu img/app: add support for testing in crosvm host/start-vm: factor out VM definition path host: add support for Wayland in VMs vm/app: add hello-wayland demo VM host/start-vm: disable cloud-hypervisor sandbox Documentation/creating-vms.adoc | 5 +++ host/initramfs/extfs.nix | 3 ++ host/rootfs/Makefile | 4 +++ host/rootfs/default.nix | 4 +-- host/rootfs/etc/s6-rc/ext-rc-init/up | 8 +++++ 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/start-vm.rs | 26 +++++++++------ img/app/Makefile | 32 +++++++++++++++++-- img/app/default.nix | 3 +- img/app/etc/mdev/iface | 2 +- img/app/etc/mdev/listen | 12 +++++++ img/app/etc/mdev/wait | 15 +++++++++ img/app/etc/s6-rc/ok-all/contents | 1 + img/app/shell.nix | 2 +- vm-lib/make-vm.nix | 14 ++++++-- vm/app/catgirl.nix | 1 + vm/app/hello-wayland.nix | 25 +++++++++++++++ vm/app/lynx.nix | 1 + 23 files changed, 159 insertions(+), 19 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 100755 img/app/etc/mdev/listen create mode 100755 img/app/etc/mdev/wait create mode 100644 vm/app/hello-wayland.nix -- 2.37.1