This previous weekend I wrote and Submitted Rust bindings for virtio drivers in the Linux kernel mailing list including a WIP sample driver for virtio-rtc device https://lore.kernel.org/all/20260505-r[email protected]/
#Virtualization #RustForLinux #kernel #RustLang #virtio
[PATCH RFC 0/6] Add Rust virtio bindings and sample device - Manos Pitsidianakis

With a few changes, a complete virtio-rng rust driver currently requires only **one** `unsafe` use, which can potentially be eliminated too. The virtio bindings have to use unsafe, but its consumers do not need to worry about it.

Also, the Rust virtio-rng performance looks to be completely on par with the C one, when using rngtest:

C:

rngtest: input channel speed: (min=544.957; avg=7819.738; max=19073.486)Mibits/s
rngtest: FIPS tests speed: (min=55.446; avg=107.397; max=111.541)Mibits/s

Rust:

rngtest: input channel speed: (min=476.837; avg=7909.806; max=19073.486)Mibits/s
rngtest: FIPS tests speed: (min=48.165; avg=107.335; max=111.541)Mibits/s

Caveat: the virtio-rng device is one of the simplest in functionality, even if it can potentially do a lot of I/O, so this was expected.
@epilys have you reproed the ~12% lower min?
@nabijaczleweli the min/max results do not seem to be stable, it probably depends on available host entropy, and the same behavior appears in both C and Rust