github FEX-Emu/FEX FEX-2601
FEX Release FEX-2601

latest releases: FEX-2607, FEX-2605, FEX-2604...
6 months ago

Read the blog post at FEX-Emu's Site!

As the developers awaken from their holiday induced hiberation, another release is upon us in the new year! Let's see what we managed to implement
before hibernation snuck up on us.

Update thunks for Vulkan 1.4.337

This update is fairly important as Proton and Mesa have started using some new extensions that we didn't previously support. So if your system had a
new driver with these extensions then dxvk/vkd3d-proton would assert out. With these updated it is no longer a problem and thunking is working again
as normal!

Fix a couple rare hangs on Wine mutex handling

FEX has a custom mutex implementation that has "writer" priority that was implemented a few months ago. We needed to implement this to help reduce
stuttering in our code cache implementation. When implementing it we actually had two bugs in the implementation for Wine that went unnoticed until
now. Our implementation is fairly smart and will spin on the mutex using ARM's highly efficient "Wait-For-Event" instruction for 1/10th of a
millisecond before deferring to the kernel mutex implementation. Because we block the mutex for such a small amount of time, it was /highly/ unlikely
to hit the kernel implementation. When we did defer to the kernel (Or Wine's implementation anyway) we had a bug in our anti-stampeding behaviour
which would cause reader threads to never wake up. Then additionally we had a bug in the calling API for the "RtlWaitOnAddress" function declaration
where it was only waiting on a 32-bit address. Causing the process to never wake up and usually crash.

A very long winded way to say we had two simple bugs that were rare and infuriating to debug because of a race.

JIT fixes

This month there weren't actually that many JIT fixes. We found a bug that was breaking Ubisoft's UPlay program which is now fixed.
Additionally we resolved some handling of self-modifying code on our Wine implementation that could fix some spurious hangs or incorrect
invalidations.

Minor Linux syscall fix

This month we noticed that Steam was using some new fcntl syscall operations that we didn't handle. This caused Steam to crash in some rare edge cases
when it actually called this syscall. We have now resolved this, and future proofed any new commands getting emulated by passing directly to the
kernel.

More code caching implementation work

This is definitely the task that has the most code land for it. There was code caching support wired up for both Linux side and Wine side. While still
a heavy Work-In-Progress, we have code caches getting generated and loaded at runtime to reduce the amount of time spent running in the JIT.
In particular, this can be thought of as trading CPU time for disk space, theoretically reducing JIT stutter if the code already existed in the cache.
Still lots of work to go to make this viable for the user, but we'll be trucking along as usual!

39C3 talk from @neobrain

This last month, neobrain had a talk going through some of the architecture of FEX-Emu. It's very informative and definitely worth the watch!
Watch the video

Raw Changes

FEX Release FEX-2601

  • ARM64Emitter

    • Force NOP padding to be enabled (9e8915e)
  • Arm64Emitter

    • Initial work for LoadConstant padding audit (d582356)
  • BranchOps

    • Use RIP relocs for direct branch targets (c57df73)
  • CMake

    • Move CMakeModules to Data/CMake (651ef64)
    • Fix mingw if host has libxxhash-dev installed (900c179)
    • Support overriding version/hash via CMake args (19d3450)
  • CodeCache

    • Fix misparenthesized expression in SaveData() (9101e70)
    • Rebase block entrypoint info (5747d1c)
    • Make LoadData Thread argument an optional pointer (bc069f2)
    • Implement automatic cache generation (eb425fe)
    • Implement runtime cache validation (93f6a8c)
    • Trigger delayed cache loading for the main executables and its interpreter (71c8436)
    • Implement cache loading (ec67670)
  • Common

    • Use LOCALAPPDATA for GetCacheDirectory on WOW64/ARM64EC (499970d)
  • Config

    • Remove stdout from OutputLog (e1c6a91)
  • Dispatcher

    • Silence warning on ARM64EC (9a12868)
  • FEXCore

    • Cleanup pointers structure (b29a78c)
    • Fixes circular dependency with thunk callback (5627ddf)
    • Switch constant emission to default to NoPad (2b4492c)
    • Revert literal optimization from #4884 (da46d51)
  • FEXOfflineCompiler

    • Implement SyscallHandler::LookupExecutableFileSection (5ca549e)
  • FEXServer

    • Add protocol interface to request code cache population (805a4c1)
  • Frontend

    • Only decode REX if it is at the correct location (c8d72ea)
    • Also fetch relocations and section bounds when validating (0a18ea8)
  • ImageTracker

    • Load AOT images (a3779be)
    • Load PE relocations when generating code caches (b87bb1d)
    • Support codemap file generation (c54dfd9)
    • Track loaded PE images for LookupExecutableFileSection (212a3f4)
  • Interpreter

    • Moves around the thread and ELF initialization code (ed1d495)
  • JIT

  • LinuxSyscalls

  • LookupCache

    • Fix mistake in nested CacheBlockMapping call (a957f1f)
  • OpcodeDispatcher

    • Explicitly calculate flags after _TelemetrySetValue (281981e)
  • Relocations

    • Disable 6-byte size optimization in InsertGuestRIPMove (c7eb4c8)
    • Switch to robin_map to improve lookup perf (4889596)
  • SHMStats

    • Avoid ISB usage when stats are disabled (6a49b8c)
  • Scripts

    • Have InstallFEX check kernel version (b407688)
  • Steam

    • Don't let the FEXServer inherit FEXServerManager's original stdout (53925dc)
  • Syscalls

    • Fix DEBUG_STRACE printing (e859109)
  • Thunks

    • Vulkan
  • Tools

  • VDSO

    • Forgot to remove a if check (144c4bf)
  • WOW64

    • Lock the JIT context and block suspend during context operations (a25d90d)
  • WinAPI

  • Windows

    • Improve handling of RWX memory (d592e2a)
    • Invalidate code in freed memory after the free syscall (cb7de45)
    • Fix RtlWaitOnAddress signature (f098b41)
    • Implement _[w]sopen file APIs (f819999)
    • Introduce ImageTracker for tracking per-loaded-image data (dc764db)
    • Switch GetSection/ExecutableFilePath to returning full paths (956f97e)
    • Split out CRT/WinAPI reimplementation (ebdbf58)
  • WritePriorityMutex

    • Add some more documentation (9fa8148)
    • Fix rare case of dropped read waiter wakes (ce9824a)
  • Misc

    • [cmake] explicit platform and bit-width checks (dbd802c)
    • [cmake] more parenthesis cleanups, linker gc module, more same-line stuff (1f6b3d5)
    • [cmake] refactor: compiler and architecture handling (51f6722)
    • [cmake] better option descriptions + more consistent language (9c0c969)
    • Constant audit (fd2ee4e)
    • _Constant audit (851fbae)
    • First round of LoadConstant auditing (5bbbe4d)
    • [cmake] Use a Find module for xxhash (5a47565)
    • [cmake] do not use uppercase command names (f24f88e)
    • [cmake] reduce usage of trivial variables (0edf961)
    • [cmake] prefer end parenthesis on same line, no space after some calls (b41b967)
    • [cmake] FEXCore: further reduce library redundancy (f153d86)
    • [cmake] propagate -ISource to all Tools (bd8f6f1)
    • [cmake] use MINGW builtin rather than custom detection (7cdef04)
    • Some minor NFC (974ba78)
    • Guest relocation support (fef1993)
    • Various trivial fixes for #5106 (296988b)
    • code-format-helper: Update urllib3 dependency (2e2563a)
  • github

    • steamrt4
  • unittests

    • ASM

      • Adds test for flags clobber in TelemetrySetValue (eb27576)
      • Test 32-bit displacement encoding (d197300)
    • FEXLinuxTests

Don't miss a new FEX release

NewReleases is sending notifications on new releases.