Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions .github/workflows/gamenative-fexcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,19 @@ jobs:

- name: Install
working-directory: fex
run: DESTDIR="$PWD"/install cmake --build build -t install
run: |
DESTDIR="$PWD"/install cmake --build build -t install
cp build/Bin/FEXOfflineCompiler*.exe install/usr/lib/wine/aarch64-windows/

- name: ccache stats
run: ccache -s

- uses: actions/upload-artifact@v6
with:
name: dll-${{ matrix.target }}
path: fex/install/usr/lib/wine/aarch64-windows/lib*.dll
path: |
fex/install/usr/lib/wine/aarch64-windows/lib*.dll
fex/install/usr/lib/wine/aarch64-windows/FEXOfflineCompiler*.exe
if-no-files-found: error
retention-days: 7

Expand Down Expand Up @@ -199,6 +203,7 @@ jobs:
run: |
mkdir -p pkg/system32
cp dlls/libarm64ecfex.dll dlls/libwow64fex.dll pkg/system32/
cp dlls/FEXOfflineCompiler64.exe dlls/FEXOfflineCompiler32.exe pkg/system32/
patches=$(grep -c -v -e '^#' -e '^$' gamenative/series)
cat > pkg/profile.json <<JSON
{
Expand All @@ -214,6 +219,14 @@ jobs:
{
"source": "system32/libwow64fex.dll",
"target": "\${system32}/libwow64fex.dll"
},
{
"source": "system32/FEXOfflineCompiler64.exe",
"target": "\${system32}/FEXOfflineCompiler64.exe"
},
{
"source": "system32/FEXOfflineCompiler32.exe",
"target": "\${system32}/FEXOfflineCompiler32.exe"
}
]
}
Expand Down
37 changes: 23 additions & 14 deletions gamenative/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,34 @@ behaviour that is not a plain correctness fix is behind an env var.

| Patch | From | What | Upstream |
|---|---|---|---|
| 0001 windows-fixes-for-protected-launchers | Dmage22/FEX-D2 `d2r/clean` (11 commits squashed) | Non-image section views, OS query for unknown executable pages, fault raise with `hlt` and the right exception code, stale NoExec retry, PF/AF through context conversion (needs the ntdll export), disk-cache extents, compiler restart at inaccessible pages, `0x67` MOVS/STOS and FS/GS decode | analysis in FEX-Emu/FEX#5328; no PR yet |
| 0002 arm64ec-load-ntdllredirectionlutsize-as-32-bits | tarikbc 0015 + upstream 3a2b1c0b43 | 32-bit load of `NtDllRedirectionLUTSize`; `b.hs` bounds check so an offset equal to the size no longer reads past the LUT | FEX-Emu/FEX#6021, fully merged (both commits). Drop at FEX-2611 |
| 0003 windows-anti-tamper-stepping-and-fault-delivery | tarikbc 0004, 0006, 0009, 0012, 0013, 0014, 0017 (v1.6.0, f4a686a0) squashed | Guest-visible protection of trapped pages, raw syscall return registers, volatile code regions, 512 MB code buffer, translation reuse, guest faults without a host trap with the exception code picked per signal (SIGILL, SIGTRAP, SIGSEGV). Env gates: `FEX_EXP_SKIP_CALLRET_RESET=1` opts in; `FEX_EXP_FASTTRAP=0`, `FEX_EXP_FASTRAISE=0` opt out. Volatile code regions were on by default here; 0005 makes them opt-in | FEX-Emu/FEX#6022, #6023; Wine bug 60461 |
| 0004 arm64ec-export-btcpu64notifynonimageviews | GameNative | Exports `BTCpu64NotifyNonImageViews` so ntdll only reports non-image views to a FEX that can take them | pairs with GameNative/proton-wine `dlls_arm64ec_emulator_notifications.patch` |
| 0005 windows-make-volatile-code-regions-opt-in | GameNative | Volatile code region detection (from 0003) runs only with `FEX_EXP_VOLATILE=1`; any other value or unset is off. On by default it misfires on JIT runtimes: TMNT: Shredder's Revenge (FNA/.NET) recompiles on its main thread, runs about 10x slower and never creates a D3D device. Age of Empires IV needs it and sets it in its overlay. Env gate: `FEX_EXP_VOLATILE=1` opts in | GameNative only |
| 0006 fexcore-fence-plain-loads-before-volatile-metadata-tso-loads | GameNative | With PE volatile metadata, a listed (TSO) load gets a `dmb ishld` in front when a plain load may precede it in the same metadata block, restoring x86 load order. Counter-Strike 2's CTSQueue pop let node->next and the tail sequence drift past its sequence re-check and crashed reading NULL+8. Outside metadata blocks nothing changes | GameNative only for now |
| 0007 fexcore-keep-guest-loads-whose-value-is-unused | GameNative | The dead-flag pass dropped a guest load whose only consumer was a flag write that a later instruction overwrote. HotSpot C1 null checks are `cmp rax,[reg]` with dead flags and rely on the fault, so a null receiver reached the next field load and the VM aborted (Necesse, 13 s after start). Guest load ops now declare side effects, as LoadMemPair already did | GameNative only for now |

Left out of 0003 on purpose: tarikbc 0002 (hides the emulator from the guest), 0007 (rewrites
| 0001 windows-fixes-for-protected-launchers | Dmage22/FEX-D2 `d2r/clean` (11 commits squashed) | Non-image section views, OS query for unknown executable pages, fault raise with `hlt` and the right exception code, stale NoExec retry (on the host exception path and in the FEX-2611 synchronous fault handler), PF/AF through context conversion (needs the ntdll export), disk-cache extents, compiler restart at inaccessible pages, `0x67` MOVS/STOS and FS/GS decode | analysis in FEX-Emu/FEX#5328; no PR yet |
| 0002 windows-anti-tamper-stepping-and-fault-delivery | tarikbc 0004, 0006, 0009, 0012, 0013, 0014, 0017 (v1.6.0, f4a686a0) squashed | Guest-visible protection of trapped pages, raw syscall return registers, volatile code regions, 512 MB code buffer, translation reuse, guest exceptions delivered straight into `KiUserExceptionDispatcher` on the guest stack (fast raise). Env gates: `FEX_EXP_SKIP_CALLRET_RESET=1` opts in; `FEX_EXP_FASTRAISE=0` opts out. The trapless fault path of tarikbc 0017 (`FEX_EXP_FASTTRAP`) is upstream since FEX-2611 and was dropped here. Volatile code regions were on by default here; 0004 makes them opt-in | FEX-Emu/FEX#6022, #6023; Wine bug 60461 |
| 0003 arm64ec-export-btcpu64notifynonimageviews | GameNative | Exports `BTCpu64NotifyNonImageViews` so ntdll only reports non-image views to a FEX that can take them | pairs with GameNative/proton-wine `dlls_arm64ec_emulator_notifications.patch` |
| 0004 windows-make-volatile-code-regions-opt-in | GameNative | Volatile code region detection (from 0003) runs only with `FEX_EXP_VOLATILE=1`; any other value or unset is off. On by default it misfires on JIT runtimes: TMNT: Shredder's Revenge (FNA/.NET) recompiles on its main thread, runs about 10x slower and never creates a D3D device. Age of Empires IV needs it and sets it in its overlay. Env gate: `FEX_EXP_VOLATILE=1` opts in | GameNative only |
| 0005 fexcore-fence-plain-loads-before-volatile-metadata-tso-loads | GameNative | With PE volatile metadata, a listed (TSO) load gets a `dmb ishld` in front when a plain load may precede it in the same metadata block, restoring x86 load order. Counter-Strike 2's CTSQueue pop let node->next and the tail sequence drift past its sequence re-check and crashed reading NULL+8. Outside metadata blocks nothing changes | GameNative only for now |
| 0006 fexofflinecompiler-load-the-config-before-initializing-logging | GameNative | The Windows offline compiler read `SilentLog` before any config was loaded and crashed at startup | to be sent upstream |
| 0007 codecache-rebase-relocation-offsets-to-the-code-buffer | GameNative | Since upstream #5840 relocation offsets are per compiled unit; the cache writer still stored them as code-buffer offsets, so every offline cache carried stale host pointers and un-rebased guest addresses. Offsets are rebased when a cache is generated or validated, and sorted on save | to be sent upstream |
| 0008 fexofflinecompiler-quote-process-all-child-arguments | GameNative | `process-all` passed child arguments unquoted, so exe names with spaces broke | to be sent upstream |
| 0009 codecache-copy-cached-code-to-a-writable-buffer-on-wow64 | GameNative | The WoW64 loader patched relocations into the read-only cache file mapping and killed the guest at start-up; it now gets a writable copy like ARM64EC (upstream #5658 covered ARM64EC only) | to be sent upstream |
| 0010 wow64-handle-exceptions-raised-before-the-first-thread | GameNative | The WoW64 exception handler read the thread state without a null check; a fault during `BTCpuProcessInit` (cache validation) killed the process silently. The overcommit path now runs before any thread access | to be sent upstream |
| 0011 codecache-keep-the-main-dispatcher-config-when-creating-the-validation-context | GameNative | The validation context's `InitCore` overwrote the shared signal handler config | to be sent upstream |
| 0012 windows-log-the-code-cache-load-phases-and-pre-thread-exceptions | GameNative | INFO lines for each phase of an offline cache load (map, copy, relocate, register, finalize, enable), visible with `FEX_SILENTLOG=0` | GameNative only |

Left out of 0002 on purpose: tarikbc 0002 (hides the emulator from the guest), 0007 (rewrites
ntdll export bytes to pass one game's hook check), 0008 (debug tool), 0010 (obsolete on Proton
11.0-2), 0016 (hooks `powrprof` from the exit thunk; the fix belongs in Wine, bug 60462).
Left out of 0001: dmage22's log-level change (cosmetic).

Patch 0003 was rebased onto 0001 by hand in three places: the volatile-code and translation-reuse
hooks in `Core.cpp` sit after 0001's compile restart point, and the fast-raise call in
`RethrowGuestException`. The two fault paths compose: 0003's trapless branch runs first, and
0001's `hlt` is the fallback when `FEX_EXP_FASTTRAP=0`.
Patch 0002 was rebased onto 0001 by hand: the volatile-code and translation-reuse hooks in
`Core.cpp` sit after 0001's compile restart point, and the fast raise replaces the final
`NtRaiseException` in `RaiseException`. FEX-2611 delivers JIT-raised guest faults on arm64ec
without a host trap itself, so 0002's own trapless path went at the 2611 rebase, and 0001's stale
NoExec retry hooks upstream's synchronous handler as well as the host exception path.

Applies on `FEX-2610`. On upstream `main` after 2026-10-12 it applies without 0002.
Dropped at FEX-2611 because upstream merged them: the `NtDllRedirectionLUTSize` 32-bit load
(FEX-Emu/FEX#6021) and the kept-guest-loads IR change (FEX-Emu/FEX#6069).

Applies on `FEX-2611`.

## When upstream changes

Expand Down
2 changes: 1 addition & 1 deletion gamenative/SERIES_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5
6
Loading
Loading