Integrate FEX in Fedora Linux
Summary
FEX is a fast emulator that allows one to run x86 and x86-64 binaries on an AArch64 Linux host. FEX requires a number of supporting components, including a RootFS image, and integration with krun to support 16k page-size hosts. The purpose of this Change is to integrate FEX itself and its supporting components into Fedora Linux, to provide a delightful out-of-box experience for users that want to run x86 and x86-64 binaries on their aarch64 systems. This also includes integration into the AArch64 Fedora KDE spin as a non-blocking component of the spin.
Owner
- Name: Davide Cavalca, Neal Gompa, Alyssa Rosenzweig
- Responsible Teams: Asahi SIG, KDE SIG
- Email: davide(at)cavalca.name, ngompa13(at)gmail.com, alyssa(at)rosenzweig.io
Current status
- Targeted release: Fedora Linux 42
- Last updated: 2024-09-12
- Announced
- Discussion thread
- FESCo issue: <will be assigned by the Wrangler>
- Tracker bug: <will be assigned by the Wrangler>
- Release notes tracker: <will be assigned by the Wrangler>
Detailed Description
When running Fedora Linux on an AArch64 host, one can normally only run AArch64 binaries. This can be a problem if the user needs to run preexisting software that was built for x86 or x86-64, which is still the predominant architecture. If the software is opensource it can sometimes be recompiled (or, even better, packaged in Fedora), but this isn't always an option and could require significant work on the user's part. For proprietary software, there is no viable option short of persuading the author to release a native AArch64 build.
FEX allows the user to sidestep this issue entirely by making it possible to run x86 and x86-64 binares on AArch64 Linux hosts, as if they were native. FEX achieves this via emulation, and it integrates with the binfmts infrastructure to provide a seamless experience. To ensure wide compatibility, FEX is also able to leverage a distribution-shipped root filesystem tree (RootFS) to provide core system libraries that the emulated binaries might need.
FEX only supports AArch64 host systems running a 4k page-size kernel. This is the default in Fedora Linux, but it presents a problem for Fedora Asahi Remix, as Apple Silicon Macs use a 16k page-size. To address this, we will leverage krun to run FEX inside a microVM with a 4k page-size kernel, thus providing a compatible environment with minimal overhead.
Feedback
(pending the initial Change discussion)
Benefit to Fedora
Users will be able to run x86 and x86-64 binaries out of the box when running Fedora Linux on their Aarch64 systems. This particularly improves the usability of Fedora KDE for day-to-day usage on AArch64 systems.
Scope
- Proposal owners:
- DONE: Package FEX in Fedora Linux - https://src.fedoraproject.org/rpms/fex-emu
- WIP: Create a Kiwi definition to produce a FEX root filesystem - https://pagure.io/fedora-kiwi-descriptions/pull-request/83
- TODO: Package the root filesystem in Fedora Linux as an RPM
- DONE: Package sommelier -- https://src.fedoraproject.org/rpms/chromiumos-platform
- WIP: Package krun - https://bugzilla.redhat.com/show_bug.cgi?id=2311969
- TODO: Integrate FEX with krun to support 16k page-size systems
- TODO: Create a comps group for FEX and supporting components
- TODO: Attach the comps group to the kde-desktop-environment group
- TODO: Create a Kiwi definition to produce a sysroot image to be used by FEX at build time to enable thunks
- TODO: Write documentation
- Other developers: assist with package reviews and provide feedback
- Release engineering: #12299
- Policies and guidelines: N/A (not needed for this Change)
- Trademark approval: N/A (not needed for this Change)
- Alignment with Community Initiatives:
Upgrade/compatibility impact
No expected upgrade or compatibility impact, this is a purely additive Change.
How To Test
Once the relevant components have been packaged and the comps group has been created, this Change will be testable with:
- dnf install @fex-x86-emulation
- ...
- profit!
User Experience
Users will be able to run x86 and x86-64 binaries out of the box when running Fedora Linux on their Aarch64 systems.
Dependencies
This is pretty much self contained.
Contingency Plan
- Contingency mechanism: (What to do? Who will do it?) Don't ship this
- Contingency deadline: N/A (not a System Wide Change)
- Blocks release? No
Documentation
The Change owners will write documentation on how to use FEX, both for general Fedora systems and in the context of Fedora Asahi Remix.