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 CE824A1DE; Thu, 25 Jun 2026 17:49:35 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id 33490A27A; Thu, 25 Jun 2026 17:49:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on atuin.qyliss.net X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DMARC_PASS,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=4.0.1 Received: from mail-106113.protonmail.ch (mail-106113.protonmail.ch [79.135.106.113]) by atuin.qyliss.net (Postfix) with ESMTPS id 19830A266 for ; Thu, 25 Jun 2026 17:49:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=colbyt.com; s=protonmail; t=1782409771; x=1782668971; bh=IQv44PZsek5qYKcUIGLlcJIkvHlTLb+PBRks53oF4DY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:From:To: Cc:Date:Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=GwblGy/4yaCnNg1aqmtRigd19y0mw/nl06qGKD4UY96Lvk9d1M6Pw3yznAxzDHYRd kvFi0FDvhBK/N2oyhAcMp5LhetmXOGJB+NqPJnLfKsr9Q95qi0yKRcW08xJzXx2a0I Eh+Z2VJEEYY/euPrYDVvzBYi1LpxbONBT71aom8tVueWDeV1HG4oX63e4BUHgamo4w VWQrdq8iEBe/Pn/etSAiv84yKKrAFvbA548HfM/vU9dFXV4unQUPIRtGpaF3BHFEi3 ZRFEA2OrAc0T+oetridFSr2ALqFpJ+ZqDDZoo4OQKuRK9QeqVGCpIqlVrhdOGIKSeI 3bc5TeXMkG3Iw== X-Pm-Submission-Id: 4gmRBx4sk1z1DDrD From: colbyt To: devel@spectrum-os.org Subject: [PATCH 3/6] vm: use vhost-user networking for crosvm Date: Thu, 25 Jun 2026 10:48:46 -0700 Message-ID: <1f9b01987e964c245ada51ca0f87500bef54bc96.1782409229.git.colby@colbyt.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: 4AQRHN36XAJG2N3TDLCNBLC6ECBFVNOV X-Message-ID-Hash: 4AQRHN36XAJG2N3TDLCNBLC6ECBFVNOV X-MailFrom: colby@colbyt.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; 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; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: colbyt X-Mailman-Version: 3.3.10 Precedence: list List-Id: Patches and low-level development discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: The crosvm VM test paths used raw tap networking for their primary network device, while the Cloud Hypervisor paths already used Spectrum's passt-backed vhost-user-net helper. Start the existing helper for crosvm and pass it to crosvm with --vhost-user net,socket=build/vhost-user-net.sock. The net VM still keeps tap1 for its downstream interface, and the start-vhost-user-net targets are marked phony like the other service-start targets. Signed-off-by: colbyt --- img/app/Makefile | 7 ++++--- vm/sys/net/Makefile | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/img/app/Makefile b/img/app/Makefile index fd75e6e..915db3d 100644 --- a/img/app/Makefile +++ b/img/app/Makefile @@ -84,6 +84,7 @@ start-vhost-user-gpu: start-vhost-user-net: mkdir -p build ../../scripts/start-passt.elb +.PHONY: start-vhost-user-net start-virtiofsd: scripts/start-virtiofsd.elb mkdir -p build @@ -127,11 +128,11 @@ run-cloud-hypervisor: $(imgdir)/appvm/blk/root.img start-vhost-user-gpu start-vh --serial file=build/serial.log .PHONY: run-cloud-hypervisor -run-crosvm: $(imgdir)/appvm/blk/root.img start-vhost-user-gpu start-virtiofsd - ../../scripts/with-taps.elb $(CROSVM_RUN) \ +run-crosvm: $(imgdir)/appvm/blk/root.img start-vhost-user-gpu start-vhost-user-net start-virtiofsd + $(CROSVM_RUN) \ -b path=$(imgdir)/appvm/blk/root.img,ro=true \ -p "console=ttyS0 root=PARTLABEL=root" \ - --net tap-name=tap0,mac=02:00:00:00:00:01 \ + --vhost-user net,socket=build/vhost-user-net.sock \ --vhost-user fs,socket=build/virtiofsd.sock \ --vhost-user gpu,socket=build/vhost-user-gpu.sock \ --vsock cid=3 \ diff --git a/vm/sys/net/Makefile b/vm/sys/net/Makefile index 653ef13..e37fe8c 100644 --- a/vm/sys/net/Makefile +++ b/vm/sys/net/Makefile @@ -63,6 +63,7 @@ debug: start-vhost-user-net: mkdir -p build ../../../scripts/start-passt.elb +.PHONY: start-vhost-user-net run-qemu: $(vmdir)/netvm/blk/root.img @../../../scripts/run-qemu.sh -m 256 -cpu max -kernel $(KERNEL) -vga none \ @@ -93,11 +94,11 @@ run-cloud-hypervisor: $(vmdir)/netvm/blk/root.img start-vhost-user-net --serial file=build/serial.log .PHONY: run-cloud-hypervisor -run-crosvm: $(vmdir)/netvm/blk/root.img +run-crosvm: $(vmdir)/netvm/blk/root.img start-vhost-user-net ../../../scripts/with-taps.elb $(CROSVM_RUN) \ -b path=$(vmdir)/netvm/blk/root.img,ro=true \ -p "console=ttyS0 root=PARTLABEL=root" \ - --net tap-name=tap0 \ + --vhost-user net,socket=build/vhost-user-net.sock \ --net tap-name=tap1,mac=02:01:00:00:00:01 \ --serial type=file,hardware=serial,path=build/serial.log \ --serial type=stdout,hardware=virtio-console,stdin=true \ -- 2.54.0