[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is it time to start implementing Xen bindings for rust-vmm?


  • To: Alex Bennée <alex.bennee@xxxxxxxxxx>, Mathieu Poirier <mathieu.poirier@xxxxxxxxxx>, Viresh Kumar <viresh.kumar@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Mon, 13 Sep 2021 16:32:46 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=N5dRS7s+ZDTghHB0p4T10LOuo63+vSRBRWP1ItYIYfc=; b=OmjaZO1+RnuxnY5Sjkmzvtm5og+aYyoCgLAPfvM7KFR7h2sJLg0V0UokQh0EyFJA95mZPs/Ln6BxFuHwlDP2gZIdJOYHTdHsOx5uTYdENhFZdQeJc9MwXEuB/74Lee0UdlEfWs/Qs/7YqjfjQrHBZLfGhXLF3UwbC3Juq+cAeaa4yYJtQ+8NAu8cIyzZ9IUyVPrzzfh/ed16oMciIAm5yIfq+uZr52ux3aAnV+OhSjIJxygDho4su8T7WHHN0zoPem2nrOZK/qc2GJ35hTlVG/mspTjw8jx+YnmTv5k4XeUIR/W4ViUsRry4ySQ9rkZxDJi+mcAiXFsl2Ey++lwu3g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CqMeOQB+cqMavrUM5tpTckMMB6QUjZeNOnExttexzZBL78se/cKUAFRDp3syH+ueEmJh2PXhhw5gCbUGoUEn/7pYACTltXxMcRklYKH6uO5nXV9l0aGKi4/9GeqUGQSyahgfxzUFowJ3WmL/yrjFcpmOrAW33OFPi95smNSGdtkx2TbUlIQz4LhMDpEe2MsD2X4BsTUeGEWBdzdoSW9EUs7KT36/s8JsYwmJW487oECNFXaAiAZV7VxK1p21vNohJHrq9RjqfEKF21lN8sdwPt/PQ+0bY+m2z5Mp3Jfml9CHcBONoZRh0i67KOdrIOad4JAT3kzsI/GarsFNN8I3vw==
  • Authentication-results: esa4.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: "rust-vmm@xxxxxxxxxxxxxxxxx" <rust-vmm@xxxxxxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stratos Mailing List <stratos-dev@xxxxxxxxxxxxxxxxxxx>, Oleksandr Tyshchenko <olekstysh@xxxxxxxxx>, Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>, Doug Goldstein <cardoe@xxxxxxxxxx>, Demi Marie Obenour <demi@xxxxxxxxxxxxxxxxxxxxxx>, Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 13 Sep 2021 15:33:05 +0000
  • Ironport-data: A9a23:QJ1BnqKeh6mu+k6wFE+RyJMlxSXFcZb7ZxGr2PjKsXjdYENS0zIFz WsaWDyOPPuOamX2etFxa4y38U4FucKDyd4wTwZlqX01Q3x08seUXt7xwmUcns+xwm8vaGo9s q3yv/GZdJhcokcxIn5BC5C5xZVG/fjgqoHUVaiUZ0ideSc+EH140UM6wLZj6mJVqYPR7z2l6 IuaT/L3YDdJ6xYsWo7Dw/vewP/HlK2aVAIw5jTSV9gS1LPtvyB94KYkDbOwNxPFrrx8RYZWc QphIIaRpQs19z91Yj+sfy2SnkciGtY+NiDW4pZatjTLbrGvaUXe345iXMfwZ3u7hB2F2Mkh9 NFPuaWSdgs3Ip/HyectWRhHRnQW0a1uoNcrIFC6uM2XiUbHb2Ht07NlC0Re0Y8wo7gtRzsUr LpBdW5LPkvra+GemdpXTsFFgMg5IdatF4QYonx6lhnSDOo8QICFSKLPjTNd9Gps3Z4TTayPD yYfQSJ0TRfkQx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A0VfNhWBkgJHK75xPN93y OstopdOuQe+lgArIpCNiSUNrzaAKXkJUqMGsJAGAdC01lp3mw8aOZGFU334+pCCbdlII3IGG D7MifqQnalYy2rDb2E3SSrH091CiMlcoxtN1lIDeQiEw4KXmv8t0RRN2j0rVQAJnA5f2ud+N 2U3ZU14IaKCo2VhiMRZBj3+HghAAFuS+1DryktPn2rcFhH6WmvIJWw7GOCM4EFGrD4MImkFp OmVmDT/TDLnXMDtxS9jC0dqpsvqQcF16gCfytusGN6IHsVibDfo6kN0ibHkd/cz7RsNuXD6
  • Ironport-hdrordr: A9a23:lXqL9aFMnEKK2PiVpLqFeJHXdLJyesId70hD6qkvc3Nom52j+/ xGws536faVslcssHFJo6HkBEDyewKiyXcT2/hsAV7CZniahILMFu9fBOTZskXd8kHFh4lgPO JbAtJD4b7LfChHZKTBkXCF+r8bqbHtmsDY5pas854ud3APV0gJ1XYJNu/xKDwReOApP+taKH PR3Ls9m9L2Ek5nEPhTS0N1EtTrlpnurtbLcBQGDxko5E2nii6p0qfzF1y90g0FWz1C7L8++S yd+jaJqZmLgrWe8FvxxmXT55NZlJ/IzcZCPtWFjowwJi/3ggilSYx9U/mpvSwzosuo9FE2+e O87ysIDoBW0Tf8b2u1qRzi103J1ysv0WbrzRuijX7qsaXCNXoHIvsEobgcXgrS6kImst05+r lMxXilu51eCg6FtDjh5vDTPisa1nackD4Hq6o+nnZfWYwRZPt6tooE5n5YF58GAWbT9J0nKu 9zF8vRjcwmMG9yV0qp/FWH/ebcG0jaRny9Mww/U42uonZrdUlCvgglLJd1pAZGyHo/I6M0rt gsfJ4Y0o2mdfVmGJ6VMt1xN/dfOla9My4kD1jiVWgPNJt3cE4l+KSHqonc2omRCes1Jd0J6c 38bG8=
  • Ironport-sdr: QNLwAyyZzbgymAIzuct5xh6d6+1WEsT+mGzfLzuZVZjoxgi6DPkA0HMv6Lmuzba0+cdhwufqFT kiK7XSkJnGGDE9FejV3KGY/QNS3hMDoYAQCSXW8uWjr8S6sq+/A4J5m8cdMapFOfFPZi7BZiGk hwV9DE/93Q4PUI3TWAjefhxvbcL90ipuMxt+tT2cKE0m8OLjUF6XLxoPQ7++izr1gt+GQ9YYtR XgfFECaQJZ+BoUD/u4PJH3PWpFh7/HkdOZjm+zV4YZ+RJIk4KB38RxkjiOQri4bkHfCk1xdxXz XhdxTusULy6ukwrA3442AKc3
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 13/09/2021 13:44, Alex Bennée wrote:
> Hi,
>
> As we consider the next cycle for Project Stratos I would like to make
> some more progress on hypervisor agnosticism for our virtio backends.
> While we have implemented a number of virtio vhost-user backends using C
> we've rapidly switched to using rust-vmm based ones for virtio-i2c,
> virtio-rng and virtio-gpio. Given the interest in Rust for implementing
> backends does it make sense to do some enabling work in rust-vmm to
> support Xen?
>
> There are two chunks of work I can think of:
>
>   1. Enough of libxl/hypervisor interface to implement an IOREQ end point.

No libxl here at all.

As of Xen 4.15, there are enough stable interfaces to implement simple
IOERQ servers.

https://github.com/xapi-project/varstored/commit/fde707c59f7a189e1d4e97c1a4ee1a2d0c378ad1
was the commit where I removed the final unstable interface from
varstored (terrible name) which is a dom0 backend for UEFI secure
variable handling.  As such, it also serves as a (not totally simple)
reference of an IOERQ server.


There are a few bits and pieces of rust going on within Xen, and a whole
load of plans.  Also, there is a lot of interest from other downstreams
in being able to write Rust backends.

We've got a placeholder xen and xen-sys crates, and placeholder work for
supporting cross-compile as x86 PV and PVH stubdomains.

The want to have a simple IOREQ server compiled either as a dom0
backend, or as a PV or PVH stubdomains influences some of the design
decisions early on, but they're all no-brainers for the longevity of the
work.

I started work on trying to reimplement varstored entirely in Rust as a
hackathon project, although ran out of time trying to make hypercall
buffers work (there is a bug with Box and non-global allocators causing
rustc to hit an assert().  In the short term, we'll have to implement
hypercall buffers in a slightly more irritating way).

Furthermore, stick to the stable hypercalls only.  Xen's C libraries are
disaster for cross-version compatibility, and you absolutely do not want
to recompile your rust program just to run it against a different
version of the hypervisor.  The plan is to start with simple IOREQ
servers, which are on fully stable interfaces, then stabilise further
hypercalls as necessary to expand functionality.

It's high time the Xen Rust working group (which has been talked about
for several years now) actually forms...

~Andrew




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.