FEX-2512 released
A new version of the FEX emulator, which allows you to run x86 applications on ARM64 Linux devices, has been released. Seven years have passed since the initial release of FEX, and the latest update demonstrates the continued vitality of this development team. They've focused their efforts on tackling some long-standing issues head-on.
One thing that had always bugged users, or at least it should have, was how applications reading the kernel's cmdline kept getting tripped up by FEX adding its own argument to the file contents. To avoid this hassle, they actually rewrote what goes into /proc/<pid>/cmdline. Now FEX uses a proper kernel interface (PR_SET_MM_MAP) that's been available all along; no more clumsy file-hopping. This means things like Mesa and KDE Plasma applications can display your app correctly now, showing its true name everywhere it should be.
This fix not only improves the system's appearance, but it also addresses a practical issue that this workaround was masking. It's encouraging to see this issue finally resolved.
Over on the Just-In-Time compilation side, they've introduced a clever guard using a page restart mechanism for the code buffer itself. Essentially, its purpose is to manage a complex scenario where memory constraints arise during Just-In-Time (JIT) operations. Before, if there wasn't enough space, writing would crash because it couldn't access an invalid memory address (a SIGSEV). Now, instead of hoping there's always plenty left, the code emitter tries to write and catches the signal – boom, error detected! Then it restarts the JIT process, but this time it asks for a larger buffer.
This isn't just about fixing crashes from especially x87-heavy applications (though that helps!). It makes FEX's whole JIT approach more resilient. So if you're running an application that pushes these limits, expect smoother operation overall now.
They haven't stopped there; groundwork is already being laid for code caching itself, a really important goal in the coming months. Even though this isn't ready yet, it's worth acknowledging their hard work here because we know it'll happen. They now have basic features like code maps and offline cache generation, essential steps toward implementing transparent code caching that operates automatically.
Keep a close eye on this feature as it evolves; FEX clearly sees its potential.
Elsewhere, there's been good progress addressing compatibility details. Some systems reported an incorrect number of CPU cores because the APICID information was always mistakenly zeroed out. This update fixes that problem entirely, allowing the underlying host system or FPGA software to generate the right worker threads for your actual core count, which should speed things up considerably during setup and potentially improve performance inside FEX itself.
Additionally, a potential compatibility issue with io_uring syscalls was addressed due to an ABI mismatch between the x86 and Arm64 versions. Although this wasn't the original plan, it's preferable to identify the issue now rather than discovering it later when applications unexpectedly attempt to use it. So they've wisely disabled these syscalls for safety across different hardware platforms until a more unified solution can be found; preventing crashes is definitely the priority here.
On another front related to performance and accuracy on specific cores, FEX has handled an errata affecting Cortex and Neoverse CPUs that only kicks in with newer instructions (like those added by FEAT_LRCPC2). They've disabled this instruction set extension precisely where it would cause problems. This change actually makes things run more reasonably well for games previously held back by overly cautious TSO emulation rules, which is a win-win really, getting away from problematic optimizations.
Finally, let's not forget the usual suspects: various other bugs have been tidied up too, both within the JIT code generation and generally during Linux system call handling. It keeps things running as reliably as possible.
Release FEX Release FEX-2512 · FEX-Emu/FEX
Another month and here we are with a new release!
