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 9B44B87C49; Fri, 30 Sep 2022 12:50:01 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 496) id CA77987B8F; Fri, 30 Sep 2022 12:49:54 +0000 (UTC) Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by atuin.qyliss.net (Postfix) with ESMTPS id 933F087B77 for ; Fri, 30 Sep 2022 12:49:51 +0000 (UTC) Received: by mail-ej1-x633.google.com with SMTP id r18so8794827eja.11 for ; Fri, 30 Sep 2022 05:49:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unikie.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=iRAJT6Ag+aZ6Pu3ezGzjZW5fA1o8zJjSnHxQwbvIr+g=; b=L6DHIFJwA4qilXW9eMWHeoE5PRgUcYh4Vo4NbubJIt2orySLpbWQ6i6HnejXc1lPnB o2YD815cPJeBAXYuDkIfmxQvq+iGTpJ4TBFP/tz5inw2oeLnxz+ORIA63I0FJZrmTaBU Z+jIe/ntB9weu/s2VlC5FZcLtomSWv/YjovmhZDA5xhYQUe2x0InCUN2zFNsHbW3Ol15 DbYM9FJbVtTCV9Okt33t/dijaf8DZ5Z6CYWVe8SNi6EzUmsVfmpCsUQmoZrMNXxK0Uba ks6ZxBrc/zEIg8mXVvULiYtLZIKmM0QWnBlYJIU/eQGwkYXAkOv1dPf6tGBsFAqNmSRN 7m3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=iRAJT6Ag+aZ6Pu3ezGzjZW5fA1o8zJjSnHxQwbvIr+g=; b=eeBGXBj3L3mnKEM7xRGPzLPJyR8DyC5u4ZMA3NvkV7VEwXnHxYakge1ycN1TmT98JW FHRzbVOOmL8lglivOf5SjLom7zPmAfQ8zrhN5fNRydDPfylttVWphse388V69koL9JMa +Zco/v3KONnw+Vj5pT9rQCopUvHJlV98/DIbMQHYT7F6IrHBUEuuh6ZyY35sJk+wynuJ K8sEX6/IzDPH/XpU2mLFs/nSmyCIygv8eDpeKg9mjKmKpLRUqU51hJG+ZDYv9Ev8jCXK J0fIqa48CYnlkFRMWlsPVaoSCD3T/4JlHdDxu6fnyNPto+Fa/OuLDQqIPEKhpO1E1AWt 0ceA== X-Gm-Message-State: ACrzQf3U4b8z76L1jJyIqbOvbFjib4upAIgRsXnIPgy2CmEk4TBFIB9J WtXYLPBDpjNfjTtw2urDIocQmb9MRXL43urb X-Google-Smtp-Source: AMsMyM5nfszlYwgpoxphSWbJY83Jm4xsblmIxOaViZLJ+rem74JRtmTegm1zO4lkStbU6uP0XQh6GQ== X-Received: by 2002:a17:906:fe46:b0:730:ca2b:cb7b with SMTP id wz6-20020a170906fe4600b00730ca2bcb7bmr6583835ejb.703.1664542190826; Fri, 30 Sep 2022 05:49:50 -0700 (PDT) Received: from x220.qyliss.net (p54b8e692.dip0.t-ipconnect.de. [84.184.230.146]) by smtp.gmail.com with ESMTPSA id x13-20020a50d60d000000b004482dd03fe8sm1590384edi.91.2022.09.30.05.49.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Sep 2022 05:49:50 -0700 (PDT) Received: by x220.qyliss.net (Postfix, from userid 1000) id C9F7E557; Fri, 30 Sep 2022 12:49:48 +0000 (UTC) From: Alyssa Ross To: devel@spectrum-os.org Subject: [RFC PATCH 05/10] img/app: add support for testing virtio-gpu Date: Fri, 30 Sep 2022 12:49:35 +0000 Message-Id: <20220930124940.1013577-6-alyssa.ross@unikie.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220930124940.1013577-1-alyssa.ross@unikie.com> References: <20220930124940.1013577-1-alyssa.ross@unikie.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: BB2H3XWCYN7QIZLTMUQBPUGZQ2LXZZ5N X-Message-ID-Hash: BB2H3XWCYN7QIZLTMUQBPUGZQ2LXZZ5N 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: crosvm sadly doesn't support socket activation or readiness notification, hence the sleep loop here. I've removed the tap device as it required privileges to set up, and was difficult to actually test with since it wouldn't be set up correctly on the host in the same way the Spectrum host would set it up. Signed-off-by: Alyssa Ross --- img/app/Makefile | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/img/app/Makefile b/img/app/Makefile index a3fefc3..145001c 100644 --- a/img/app/Makefile +++ b/img/app/Makefile @@ -6,6 +6,8 @@ # QEMU_KVM = qemu-system-x86_64 -enable-kvm. QEMU_KVM = qemu-kvm CLOUD_HYPERVISOR = cloud-hypervisor +CROSVM = crosvm +CROSVM_DEVICE_GPU = $(CROSVM) device gpu prefix = /usr/local imgdir = $(prefix)/img @@ -96,6 +98,17 @@ build/etc/s6-rc: $(VM_S6_RC_FILES) s6-rc-compile $@ $$dir; \ exit=$$?; rm -r $$dir; exit $$exit +start-vhost-user-gpu: + rm -f vhost-user-gpu.sock + $(CROSVM_DEVICE_GPU) \ + --socket vhost-user-gpu.sock \ + --wayland-sock "$$XDG_RUNTIME_DIR/$$WAYLAND_DISPLAY" \ + --params '{"context-types":"cross-domain"}' & + while ! [ -S vhost-user-gpu.sock ]; do + sleep 1 + done +.PHONY: start-vhost-user-gpu + run-qemu: build/host/appvm/blk/root.img $(QEMU_KVM) -m 128 -cpu host -machine q35,kernel=$(KERNEL) -vga none \ -drive file=build/host/appvm/blk/root.img,if=virtio,format=raw,readonly=on \ @@ -108,13 +121,14 @@ run-qemu: build/host/appvm/blk/root.img -device virtconsole,chardev=virtiocon0 .PHONY: run-qemu -run-cloud-hypervisor: build/host/appvm/blk/root.img +run-cloud-hypervisor: build/host/appvm/blk/root.img start-vhost-user-gpu $(CLOUD_HYPERVISOR) \ --api-socket path=vmm.sock \ - --memory size=128M \ + --memory size=128M,shared=on \ --disk path=build/host/appvm/blk/root.img,readonly=on \ path=$(RUN_IMG),readonly=on \ --net tap=tap0,mac=0A:B3:EC:00:00:00 \ + --gpu socket=vhost-user-gpu.sock \ --kernel $(KERNEL) \ --cmdline "console=ttyS0 root=PARTLABEL=root" \ --console tty \ -- 2.37.1