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 6591656C13; Fri, 21 Jul 2023 18:01:02 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id DE67256B74; Fri, 21 Jul 2023 18:00:59 +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 3761E56BC2 for ; Fri, 21 Jul 2023 18:00:56 +0000 (UTC) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id DC1BE3200985 for ; Fri, 21 Jul 2023 14:00:54 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Fri, 21 Jul 2023 14:00:55 -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=1689962454; x= 1690048854; bh=tDvIfGnb5GoB2dKBpuA3bYc2nc6tZuiXOQkVVYEPCdQ=; b=g vQivJUPcf7ZB9+qsz6mzB1oEmYQhw2jVgTMKp6aU5U5Jsdu2vaXdgUXpwoS25E86 g63wqXh38G1ILC2LRx06pPqV4pQeNCfbj4sVL4yENASIV8FPMeAbCvB+KfpD9roV HIHrMDSpT9U/xnfe+AkRmBThAA7ieud7te97JJtsZ0YCCqhmsOTYJOyHjqaeezPF kDgrAhzxKXG8Y1cwEfyYaFzJvG3xLAShST+KBWpE7P4h3ZNJAGE0q0HKhxglqtpn rI7qlm/Nv7kKS2lfCaOv12G+SfouyVMuWuH7l6CaKwTvyEzK+MwnxmjI736cACZe zqvQvkahyDXyaj/WnvCzg== 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=1689962454; x=1690048854; bh=t DvIfGnb5GoB2dKBpuA3bYc2nc6tZuiXOQkVVYEPCdQ=; b=QhtD+1s0BCyiAu+Ja kYp8zFuJHJtIYn30VyYSR5yX+Ne73ED2K3EgJqyHEoh/M5oLxsnCJoj3rTLgJFK3 UU3S9fcw0qsN2PCr59metENjhEcZdERCj9bl7/4aYW1rfd4KBDQPmpRM+BuP1IGd +8KEVpuk1b4pzmEMKY7BciJkZiSo9UCTc1bh2L0O6xCvB9xuvyUqSK5v7AewzgCM KRrZAYCUeI1hVi/8isyEU1yRrX7b2flJPw1p1HGmpaafrD23N8Hub3IMYO8vD2Iw WTyqqXHbNEYpyG2/Vlm6kEfDImOclDAg/a5cOKM6BpqSgSEO/dMYpnqdFLFbgTH8 E+Rhw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrhedvgdduudehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehlhihsshgrucftohhsshcuoehhihesrghlhihsshgrrdhi sheqnecuggftrfgrthhtvghrnhepgfefudekvdelieelledufeevheeglefggedvudejvd dtffeuueevffehleejkedvnecuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehm rghilhhfrhhomhephhhisegrlhihshhsrgdrihhs X-ME-Proxy: Feedback-ID: i12284293:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Fri, 21 Jul 2023 14:00:54 -0400 (EDT) Received: by x220.qyliss.net (Postfix, from userid 1000) id B245E732D; Fri, 21 Jul 2023 18:00:52 +0000 (UTC) From: Alyssa Ross To: devel@spectrum-os.org Subject: [PATCH v3 4/6] vm: add support for testing in crosvm Date: Fri, 21 Jul 2023 18:00:17 +0000 Message-Id: <20230721180015.597099-5-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: FPPQ7M7YTO73L252BG6OMJJWW2MYVACY X-Message-ID-Hash: FPPQ7M7YTO73L252BG6OMJJWW2MYVACY 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 This is useful because it allows comparing how our patched cloud-hypervisor behaves against crosvm's implementation. Signed-off-by: Alyssa Ross Co-authored-by: Alyssa Ross Signed-off-by: Alyssa Ross --- img/app/Makefile | 12 ++++++++++++ lib/common.mk | 1 + vm/sys/net/Makefile | 11 +++++++++++ vm/sys/net/shell.nix | 2 +- 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/img/app/Makefile b/img/app/Makefile index 0742440..35db476 100644 --- a/img/app/Makefile +++ b/img/app/Makefile @@ -125,6 +125,18 @@ run-cloud-hypervisor: $(imgdir)/appvm/blk/root.img start-vhost-user-gpu start-vi --serial pty .PHONY: run-cloud-hypervisor +run-crosvm: $(imgdir)/appvm/blk/root.img start-vhost-user-gpu start-virtiofsd + $(CROSVM_RUN) \ + --disk $(imgdir)/appvm/blk/root.img \ + --disk $(RUN_IMG) \ + -p "console=ttyS0 root=PARTLABEL=root" \ + --vhost-user-fs build/virtiofsd.sock:virtiofs0 \ + --vhost-user-gpu build/vhost-user-gpu.sock \ + --serial type=file,hardware=serial,path=build/crosvm.log \ + --serial type=stdout,hardware=virtio-console,stdin=true \ + $(KERNEL) +.PHONY: run-crosvm + run: run-$(VMM) .PHONY: run diff --git a/lib/common.mk b/lib/common.mk index 81754b9..bba7f22 100644 --- a/lib/common.mk +++ b/lib/common.mk @@ -13,6 +13,7 @@ CPIO = cpio CPIOFLAGS = --reproducible -R +0:+0 -H newc CROSVM = crosvm CROSVM_DEVICE_GPU = $(CROSVM) device gpu +CROSVM_RUN = $(CROSVM) run MCOPY = mcopy MKFS_FAT = mkfs.fat MMD = mmd diff --git a/vm/sys/net/Makefile b/vm/sys/net/Makefile index bbeb40b..d31477a 100644 --- a/vm/sys/net/Makefile +++ b/vm/sys/net/Makefile @@ -119,6 +119,17 @@ run-cloud-hypervisor: build/host/data/netvm/blk/root.img --serial pty .PHONY: run-cloud-hypervisor +run-crosvm: build/host/data/netvm/blk/root.img + $(CROSVM_RUN) \ + --disk build/host/data/netvm/blk/root.img \ + -p "console=ttyS0 root=PARTLABEL=root" \ + --net tap-name=tap0 \ + --net tap-name=tap1,mac=0A:B3:EC:80:00:00 \ + --serial type=file,hardware=serial,path=build/crosvm.log \ + --serial type=stdout,hardware=virtio-console,stdin=true \ + $(KERNEL) +.PHONY: run-crosvm + run: run-$(VMM) .PHONY: run diff --git a/vm/sys/net/shell.nix b/vm/sys/net/shell.nix index 7710438..39ba520 100644 --- a/vm/sys/net/shell.nix +++ b/vm/sys/net/shell.nix @@ -7,5 +7,5 @@ import ../../../lib/eval-config.nix ({ config, ... }: with config.pkgs; { nativeBuildInputs ? [], ... }: { - nativeBuildInputs = nativeBuildInputs ++ [ cloud-hypervisor jq qemu_kvm reuse ]; + nativeBuildInputs = nativeBuildInputs ++ [ cloud-hypervisor crosvm jq qemu_kvm reuse ]; })) -- 2.40.1