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 0C89756B67; Fri, 21 Jul 2023 18:00:57 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id B251E56BBE; Fri, 21 Jul 2023 18:00:52 +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 0B20656BBC for ; Fri, 21 Jul 2023 18:00:49 +0000 (UTC) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id B05B9320092A for ; Fri, 21 Jul 2023 14:00:47 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Fri, 21 Jul 2023 14:00:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alyssa.is; h=cc :content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1689962447; x= 1690048847; bh=oxFl+BFTDnY/F47KbvYLDARxoYsRG2C9HaOoWewy0Zc=; b=o DWkn/ky3QRswDOYKoR2GpjXY1IWku+pao7bFAZ8B5E9iV3mPrhKT/20dDh6kvfxm rbZ4U6lgCWmFbA9k9fZwvjB1Bb+q7Mt4FEzrp1m+0wX4xMFq+MEPktfb3523XStH DEXnrR88Bmt97b8KBKePqdzFvuEqs7KaYkEFkagsRG2R2qBk+C0c7Rbp3cKlqmgT CH9eeZWhC4X8d1R9Nz6Cl8Fc8uOsr/CmGcFEVUGAIU64aA+3TGi6fp5/R3JCKQiH UtiqbeqHsDw6TE3R+FMr5Rsr4+EDjZm1TWUeHr/CE/z1/GKRkWazfmqixE/363AB a6ZMkwmEFAXU9SVZucr0Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:feedback-id:feedback-id:from:from:in-reply-to :in-reply-to:message-id:mime-version:references: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=1689962447; x=1690048847; bh=o xFl+BFTDnY/F47KbvYLDARxoYsRG2C9HaOoWewy0Zc=; b=M8rbuGthp8Fzx+S2O IIl0MbLpuwrOacvY7nvHkz04S9t/suREgXq4frdC5OMw56HbTME0+RhhOOZMp8aC 2swuAE1U3cGswuDrI5f+/JqsZGgo5mkOBtK74g+CWV6VL8DplztdkBNFalqJWxmg +mtN1jzOcOn2TP0bszKwbdHUWLOPXhHr9qjYgd6JTM/hkuoyTeEyiwVnlG7Tv2Il tKXfFeH8D/fjaRSe0Js/vWgADI+qqt6YS6iuq753IX+BJ7byNbny8IbGFd5iDaV5 Pej+YDf2OfjMuYoxDEjoUsRmjs4z/LxMegKfKka8hcaWqLfY1OMhYzW613O0QiON IUx9w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrhedvgdduudehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehlhihsshgrucftohhsshcuoehhihesrghlhihsshgrrdhi sheqnecuggftrfgrthhtvghrnhepgfefudekvdelieelledufeevheeglefggedvudejvd dtffeuueevffehleejkedvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehm rghilhhfrhhomhephhhisegrlhihshhsrgdrihhs X-ME-Proxy: Feedback-ID: i12284293:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Fri, 21 Jul 2023 14:00:46 -0400 (EDT) Received: by x220.qyliss.net (Postfix, from userid 1000) id A7259732B; Fri, 21 Jul 2023 18:00:45 +0000 (UTC) From: Alyssa Ross To: devel@spectrum-os.org Subject: [PATCH v3 3/6] img/app: add support for testing virtio-gpu Date: Fri, 21 Jul 2023 18:00:15 +0000 Message-Id: <20230721180015.597099-4-hi@alyssa.is> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230721180015.597099-1-hi@alyssa.is> References: <20230721180015.597099-1-hi@alyssa.is> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: 2QDNCPAQJHW3XWP2P6XSEUDCBMFIEKNS X-Message-ID-Hash: 2QDNCPAQJHW3XWP2P6XSEUDCBMFIEKNS 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: From: Alyssa Ross crosvm sadly doesn't support socket activation or readiness notification, hence the sleep loop here. Signed-off-by: Alyssa Ross Signed-off-by: Alyssa Ross --- img/app/Makefile | 13 ++++++++++++- img/app/shell.nix | 2 +- lib/common.mk | 2 ++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/img/app/Makefile b/img/app/Makefile index 1ea0d66..0742440 100644 --- a/img/app/Makefile +++ b/img/app/Makefile @@ -1,5 +1,6 @@ # SPDX-License-Identifier: EUPL-1.2+ # SPDX-FileCopyrightText: 2021-2023 Alyssa Ross +# SPDX-FileCopyrightText: 2022 Unikie include ../../lib/common.mk @@ -77,6 +78,15 @@ build/etc/s6-rc: $(VM_S6_RC_FILES) s6-rc-compile $@ $$dir; \ exit=$$?; rm -r $$dir; exit $$exit +start-vhost-user-gpu: + rm -f build/vhost-user-gpu.sock + $(CROSVM_DEVICE_GPU) \ + --socket build/vhost-user-gpu.sock \ + --wayland-sock "$$XDG_RUNTIME_DIR/$$WAYLAND_DISPLAY" \ + --params '{"context-types":"cross-domain"}' & + while ! [ -S build/vhost-user-gpu.sock ] && sleep .1; do :; done +.PHONY: start-vhost-user-gpu + start-virtiofsd: mkdir -p build $(S6_IPCSERVER_SOCKETBINDER) -B build/virtiofsd.sock \ @@ -100,7 +110,7 @@ run-qemu: $(imgdir)/appvm/blk/root.img start-virtiofsd -device virtconsole,chardev=virtiocon0 .PHONY: run-qemu -run-cloud-hypervisor: $(imgdir)/appvm/blk/root.img start-virtiofsd +run-cloud-hypervisor: $(imgdir)/appvm/blk/root.img start-vhost-user-gpu start-virtiofsd rm -f build/vmm.sock @../../scripts/run-cloud-hypervisor.sh \ --api-socket path=build/vmm.sock \ @@ -108,6 +118,7 @@ run-cloud-hypervisor: $(imgdir)/appvm/blk/root.img start-virtiofsd --disk path=$(imgdir)/appvm/blk/root.img,readonly=on \ --disk path=$(RUN_IMG),readonly=on \ --fs tag=virtiofs0,socket=build/virtiofsd.sock \ + --gpu socket=build/vhost-user-gpu.sock \ --kernel $(KERNEL) \ --cmdline "root=PARTLABEL=root" \ --console tty \ diff --git a/img/app/shell.nix b/img/app/shell.nix index ba75fcc..0c94f1d 100644 --- a/img/app/shell.nix +++ b/img/app/shell.nix @@ -15,7 +15,7 @@ with config.pkgs; # so we have to list virtiofsd first. virtiofsd - cloud-hypervisor execline jq qemu_kvm reuse s6 + cloud-hypervisor crosvm execline jq qemu_kvm reuse s6 ]; runDef = import run { inherit config; }; diff --git a/lib/common.mk b/lib/common.mk index e32fecb..81754b9 100644 --- a/lib/common.mk +++ b/lib/common.mk @@ -11,6 +11,8 @@ QEMU_KVM = qemu-kvm BACKGROUND = background CPIO = cpio CPIOFLAGS = --reproducible -R +0:+0 -H newc +CROSVM = crosvm +CROSVM_DEVICE_GPU = $(CROSVM) device gpu MCOPY = mcopy MKFS_FAT = mkfs.fat MMD = mmd -- 2.40.1