On-Prem
Patch series would bring memory-safe code to Linux’s s390 port, with compiler caveats attached
IBM’s effort to bring in-kernel Rust to its mainframe platform has taken a step forward, although anyone hoping to use it on production iron will need to be comfortable with a nightly Rust compiler for now.
Engineer Jan Polensky has submitted a patch series titled “s390: enable Rust support and add required arch glue.” If accepted, it will allow Rust code to be used in the Linux kernel on IBM mainframe hardware, which the kernel still refers to as s390 after the generation of IBM mainframe kit introduced in 1990. He notes:
Rust support on s390 requires a small set of architecture-specific pieces before the generic Rust kernel infrastructure can be used.
The series wires up s390 as a Rust-capable 64-bit architecture, adds the missing assembly interfaces needed by Rust for WARN/BUG reporting and for static branches, and adjusts bindgen parameters to avoid repr layout conflicts caused by packed and aligned s390 structures.
s390 currently requires a nightly rustc due to -Zpacked-stack, and the minimum tool version gating is adjusted accordingly.
For now, using a nightly build of the Rust compiler does not sound to
us like the sort of thing many conservative mainframe shops are likely to embrace with enthusiasm, but even big new features have to start somewhere.
This is a significant step. When Rust was introduced into the kernel in 2022, The Register mentioned a problem that we rarely see raised elsewhere: while the kernel is generally compiled with GCC, the standard
Rust compiler, rustc, is
based on LLVM instead. Wikipedia has a list of LLVM
backends, and although there are a growing number, it’s a shorter list
than GCC’s 48. There is
an experimental GCC front-end for
Rust but it’s not ready for the prime time yet.
The Linux kernel itself has supported compilation using LLVM since
kernel 6.9 over two years ago.
At the moment, the kernel development team is still working on
version 7.1, which at the time of writing is still on release candidate
3 – so relatively early days. Last month, we reported on its new
NTFS driver and the removal
of some fairly ancient hardware support.
The final version of Linux 7.1 will probably appear about halfway
through 2026, meaning that kernel 7.2 is still quite far off. It might
be in time to appear in Ubuntu 26.10 – but then again, we suspect that
very few IBM mainframe customers use interim Ubuntu releases. ®