Shared code buffer support introduced the concept of having a single GuestToHostMaps shared across many threads. In the common case all threads will share one however if e.g. a resize recently occured and specific thread is yet to compile any code with the new codebuffer it will still use the old GuestToHostMap. The current invalidation approach handles this by repeatedly calling erase for every single thread's GuestToHostMap, even if it is repeated. An accumulator is used to ensure when two threads share a map, the L1/L2 cache entries in the second thread will still be invalidated even if the the iteration for the first thread removed them from the map. Unfortunately this is incredibly slow in cases with many threads, as a significant number of redundant map lookups and L1/L2 cache erasures on threads that never even observed a given block can occur. Solve this by introducing a two-pass model: - First, all active codebuffers (and their associated GuestToHostMaps) have their entries invalidated for the given range, these codebuffers are tracked internally within FEXCore. It is at this point that delinking callbacks are ran. - Second, each thread will have its caches invalidated. But rather than naively invalidating the L1/L2 caches for every invalidated block for every thread, threads now track on their own what specific entries have been potentially fetched into their L1/L2 caches. This is aided by GuestToHostMap now tracking the pages each block touches. (an inverse CodePages so to speak).
FEX: Emulate x86 Programs on ARM64
FEX allows you to run x86 applications on ARM64 Linux devices, similar to qemu-user and box64. It offers broad compatibility with both 32-bit and 64-bit binaries, and it can be used alongside Wine/Proton to play Windows games.
It supports forwarding API calls to host system libraries like OpenGL or Vulkan to reduce emulation overhead. An experimental code cache helps minimize in-game stuttering as much as possible. Furthermore, a per-app configuration system allows tweaking performance per game, e.g. by skipping costly memory model emulation. We also provide a user-friendly FEXConfig GUI to explore and change these settings.
Prerequisites
FEX requires ARMv8.0+ hardware. It has been tested with the following Linux distributions, though others are likely to work as well:
- Arch Linux
- Fedora Linux
- openSUSE
- Ubuntu 22.04/24.04/24.10/25.04
An x86-64 RootFS is required and can be downloaded using our FEXRootFSFetcher tool for many distributions.
For other distributions you will need to generate your own RootFS (our wiki page might help).
Quick Start
For Ubuntu 22.04, 24.04, 24.10 and 25.04
Execute the following command in the terminal to install FEX through a PPA.
curl --silent https://raw.githubusercontent.com/FEX-Emu/FEX/main/Scripts/InstallFEX.py | python3
This command will walk you through installing FEX through a PPA, and downloading a RootFS for use with FEX.
For other Distributions
Follow the guide on the official FEX-Emu Wiki here.
Navigating the Source
See the Source Outline for more information.