XCP-ng Initating Effort To Rewrite Xen Components In Rust

Written by Michael Larabel in Virtualization on 18 March 2023 at 12:12 PM EDT. 64 Comments
VIRTUALIZATION
The focus of this new effort isn't to immediately rewrite the Xen virtualization hypervisor in Rust but to begin gradually working toward rewriting some of the smaller Xen Project components in the Rust programming language and to see how everything pans out.

The XCP-ng project announced their intention to begin working on future contributions to the Xen Project in the Rust programming language. As it stands now Xen and XCP-ng are made up of a mix of C, Python, OCaml, and Go code. Like many other projects, they are eyeing the Rust programming language for being both performant and its memory safety traits. Rust's safety abilities while not having a garbage collector is desired by the XCP-ng crew and Rust's borrow checker may further help the Xen cause.

Xen logo


As for Xen itself in Rust, they note:
That's a very good question: should we start to bring Rust directly inside the Xen hypervisor itself?

Since it's a very "low level" piece of code, a micro-kernel, you can already have very specific and weird issues while it's mostly written in C (and tiny bits in Assembly). It's not rare to have something like a compiler optimization generating bugs, despite the maturity of the C ecosystem (even with gcc)!

That's why we prefer to start with simple things and a higher level first, while getting more experience in Rust. The other thing to do is to monitor Rust maturity on "very close to the metal" behaviors and potential unwanted side effects.

More details on the XCP-ng blog for those interested.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week