From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.3 (2019-12-06) on atuin.qyliss.net X-Spam-Level: X-Spam-Status: No, score=-1.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.3 Received: by atuin.qyliss.net (Postfix, from userid 496) id 331EF5AD4; Sun, 2 Aug 2020 23:03:46 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by atuin.qyliss.net (Postfix) with ESMTP id 916A45A43; Sun, 2 Aug 2020 23:03:39 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 496) id 2EF265A3A; Sun, 2 Aug 2020 23:03:38 +0000 (UTC) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by atuin.qyliss.net (Postfix) with ESMTPS id 4AD455A39; Sun, 2 Aug 2020 23:03:34 +0000 (UTC) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 38D905C00FF; Sun, 2 Aug 2020 19:03:33 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sun, 02 Aug 2020 19:03:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alyssa.is; h= from:to:subject:date:message-id:mime-version:content-type; s= fm3; bh=AutmFi2R3S8imaQPj67U7J7FKQWVn0MExAWsNHeneL8=; b=Rorf7cL0 ifA4TzbtwONMquE8fOQjGoOLOAH6CmwbEPoEnqX49FJvxyaPk7Qo7ioRPGdY/3nW jsfHRIkUFLp8xQgfd4LgLQnQa/+HH/PAvkcDO5l8/MgT6bJwRgNrnXOYXNrGlYXy 8AUrsG1AVKdK+VZVJIR3B5XmMUQ0n6y8nTJ+sR4NyWjnPUIhBVsSscTF6gEgbd86 82+LYf2P1ZdUgHpHXIjB9D+Mzvv1T3eSr4BHKYqy6V5IonTy+u3JBbj+z6BsY1/a Hx0vPxtGrLGLfkBQOd3gHJMX4AoZJTMUfv91Vj9L9YoP89uMjfPaBWgVhV+Z9GYn DjGzO59iKRd28Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=AutmFi2R3S8imaQPj67U7J7FKQWVn 0MExAWsNHeneL8=; b=bvrV72sxaRUuRmGibn4waaAjgsHoQ5OyHI8B5CdS/V2a+ buIUwh/gJnTinQWg2wicS4wLrUs47XmKh/3cmBGjtJ/WWSjuj7Vr1eUOb7fl8EME imuvEW8BA3Spm7DdORKDfYwDSYTg+1BSve68F7Bp/4tLojnW8GWTRr9dX1ngKMIg 2Zb9katA4Ftp/WL7KbaFLjbUCkk0TT91Ccm1IcK3+kHn0yec1fhfNxyl8YLwGrhk Lt76n8kr0Hmm3JnD40ynpX9wl9f7PiVAqR93lOJtbsH6bPqpBTPA/BsFMu8dHvHG j+Pcmzoh0OVElECVjPcBIx4CkjgERCZgxN8MNEqgg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrjeefgddugecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkfggtgesthdtredttddttd enucfhrhhomheptehlhihsshgrucftohhsshcuoehhihesrghlhihsshgrrdhisheqnecu ggftrfgrthhtvghrnhepteelleeuvddvvdfhieekheethfejgeetheeftddthfdtgeevgf dtgeefueetffevnecuffhomhgrihhnpehgihhthhhusgdrtghomhdpohhpvghnvhhsfihi thgthhdrohhrghdpshhpvggtthhruhhmqdhoshdrohhrghenucfkphepgeeirdektddrud egvddrkeefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhho mhephhhisegrlhihshhsrgdrihhs X-ME-Proxy: Received: from x220.qyliss.net (p2e508e53.dip0.t-ipconnect.de [46.80.142.83]) by mail.messagingengine.com (Postfix) with ESMTPA id A1039328005E; Sun, 2 Aug 2020 19:03:32 -0400 (EDT) Received: by x220.qyliss.net (Postfix, from userid 1000) id 39159584; Sun, 2 Aug 2020 23:03:29 +0000 (UTC) From: Alyssa Ross To: discuss@spectrum-os.org, devel@spectrum-os.org Subject: This Week in Spectrum, 2020-W31 Date: Sun, 02 Aug 2020 23:03:27 +0000 Message-ID: <87wo2glkg0.fsf@alyssa.is> MIME-Version: 1.0 Content-Type: text/plain Message-ID-Hash: JWDNAXZJE4XEIP6CXBCICFLQYPFOPJGF X-Message-ID-Hash: JWDNAXZJE4XEIP6CXBCICFLQYPFOPJGF X-MailFrom: hi@alyssa.is X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.3.1 Precedence: list List-Id: Patches and low-level development discussion Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: DPDK ---- Last week, I'd just figured out how to do a normal vhost-user setup with a QEMU VM connected to DPDK. This week, I wanted to try to move DPDK into another VM using the experimental virtio-vhost-user driver, taking the host system out of the networking equation altogether. In theory this should have been a very simple change, but I couldn't get it to work. DPDK claimed to be forwarding packets to the ethernet device I'd attached to the backend VM (the one running DPDK), but networking in the frontend VM (what you might think of as the application VM) didn't work at all. It tried and failed to do DHCP, and so couldn't progress beyond that. A breakthrough came when I thought to look at the logs of my local DHCP server. I saw that it was actually receiving requests from the VM, and assigning it an IP address. Once I realised this, I hypothesised that outgoing traffic was working, but not incoming. Finally having something to look for, I had a look through the DPDK virtio-vhost-user driver[1], and my suspicion was confirmed in an unexpected way. It looks like incoming traffic (from the perspective of the virtio-vhost-user frontend) is not actually implemented at all! But with outbound traffic working, this means that I'm confident enough I understand virtio-vhost-user enough to be able to leave this here for now. From Spectrum's side, I can now be pretty sure that everything should be workable, so we can just wait a bit for virtio-vhost-user to get a bit further along and then revisit it. And since the frontend has no idea it's talking to virtio-vhost-user instead of normal vhost-user, we can use normal (host-based) vhost-user for now, and drop virtio-vhost-user in down the line. A couple of outstanding questions I still don't know the answer to about DPDK are: - How will routing work if I have multiple frontend VMs with multiple virtio-vhost-user connections all wanting to use the same network device? Will I want to use something like Open vSwitch[2] for that? - DPDK by default uses a busyloop to check for data to process, for efficiency. This is obviously not appropriate for a workstation-focused operating system. There is an interrupt-based mode, though, but I don't know how to use it yet. Since I consider the concept proven, though, I'm going to punt on these for now. The longer I leave these questions, the more likely it is that a kernel driver for virtio-vhost-user will emerge and we can use that instead. That's not to say I want to leave inter-guest networking hanging forever, but I have other inter-guest networking bits I can switch focus to for now, and once those are down I can revisit the virtio-vhost-user backend situation. [1]: https://github.com/ndragazis/dpdk-next-virtio/blob/2d60e63/drivers/virtio_vhost_user/trans_virtio_vhost_user.c#L379 [2]: https://www.openvswitch.org/ crosvm ------ I started integrating the vhost-user-net code from Cloud Hypervisor into crosvm. I'm at the point where I can get all the copied Cloud Hypervisor code to compile in crosvm, which is pretty good! I have not yet written the code to actually start one of these devices yet, though, so I haven't been able to test it yet. It's been interesting to look at Cloud Hypervisor because it's a codebase that is heavily based on crosvm (even more so than Firecracker is), but that has also evolved and diverged from it. It's especially interesting to see stuff where parallel evolution occurred between the crosvm and Cloud Hypervisor codebases, or when Cloud Hypervisor changed how some crosvm code worked, and then later changed it back again. The codebases were still similar enough that I could have the cloud-hypervisor device integrated into the crosvm codebase in a day, although there's lots of code duplication that will have to be dealt with -- I copied over a bunch of supporting code rather than trying to integrate it into the crosvm equivalents to get the code running for the first time in an environment as similar as possible to the one it was designed for. I expect that when I test the device in crosvm it'll probably work fairly quickly if not first try. The more complicated part will be a bit of a change to how crosvm does guest memory that isn't strictly necessary but is important for security. crosvm allocates all guest memory in a single memfd. This means that, to share guest memory with another process, like when using vhost-user, the only option is to share all of guest memory. This would sort of defeat the purpose of hardware isolation in Spectrum! But from what I could tell -- I'm not 100% on this -- the guest memory abstraction in cloud-hypervisor is more advanced, and I think it might support multiple memfds backing guest memory for this sort of thing. I'll have to adapt crosvm to that model to be able to use vhost-user securely. website ------- The new "Bibliography" page is up[3]! Lots of links to relevant resources about concepts important to Spectrum. :) [3]: https://spectrum-os.org/bibliography.html It's a bit of a relief to have returned from the uncertain world of DPDK to the familiar territory of crosvm. I'm confident that the next bit of work here (vhost-user in crosvm) won't be that much of a big deal. Hopefully, we'll have at interim networking to a reasonable degree fairly soon. After that, I plan to look at file sharing, possibly with vhost-user-fs (virtio-fs over vhost-user), which I noticed cloud-hypervisor implements today. That should be pretty similar to the networking stuff, although I don't think any virtio-fs virtio-vhost-user code exists at the moment.