Merge remote-tracking branch 'origin/main' into frozen-session-disk-spill

This commit is contained in:
Kurt Himebauch committed 2026-12-05 04:08:34 -05:00
commit 088e9994a0
104 files changed
+15184 -317

No files matched your search

+54
View File
@@ -0,0 +1,54 @@
# Easy Anti-Cheat and BattlEye
On a Steam Deck, Proton loads Valve's anti-cheat runtimes (Proton EasyAntiCheat Runtime, app 1826330, and
Proton BattlEye Runtime, app 1161040). Their bridge libraries are x86 only, so the ARM64 DroidDeck-Proton
cannot load them. Games that need them run an x86-64 DroidDeck-Proton under FEX instead.
## Routing
The Proton launchers (`steam-compatibility`: the built-in DroidDeck-Proton launcher and the wrapper put around
every tool in `compatibilitytools.d`) check each `run` and `waitforexitandrun` before any ARM64 setup:
- **Condition.** The game folder (`STEAM_COMPAT_INSTALL_PATH`, three levels deep) holds one of
`EasyAntiCheat/Settings.json`, `easyanticheat_x64.so`, `BEClient_x64.so` or `BEService_x64.exe`. No
title, app ID or device list is involved.
- **Chosen tool.** Only launches through DroidDeck's own Proton (the built-in launcher or a `DroidDeck-Proton*`
folder) are moved. A game set to any other tool, such as GE-Proton, Bionic or Valve's Proton, in DroidDeck or
in Steam's Properties, runs on that tool and the launcher logs that it was chosen.
- **Tool.** The newest `compatibilitytools.d/DroidDeck-Proton*` whose layout is x86-64
(`files/lib/wine/x86_64-unix`, no `files/bin-arm64`).
- **Runtime.** `PROTON_EAC_RUNTIME` or `PROTON_BATTLEYE_RUNTIME` when it already points at a folder with the
bridge libraries, otherwise the runtime's folder in any Steam library.
- **Launch.** `droiddeck-fex proton <tool>/proton <verb> <args>`: FEX with the Steam Linux Runtime rootfs,
keeping the game's own `STEAM_COMPAT_DATA_PATH` prefix.
Without the x86-64 tool or the runtime files the launch stays on ARM64 and the launcher logs why.
`DROIDDECK_ANTICHEAT=off` in the game's launch options keeps it on ARM64. Picking the x86-64 tool for a
game in Steam always runs it under FEX.
## Why the x86-64 build needs its own Wine patches
Android kernels use 39-bit user address spaces. Easy Anti-Cheat's launcher maps fixed memory at
`0x7001_0000_0000`, which FEX serves from emulated guest pages (`tools/fex/patches/0027`). Exclusive load and store pairs on that
memory are emulated as a compare-and-swap, so hosts without LSE atomics work too. `tools/fex/probes/guest-high-memory.c`
checks loads, stores, atomics, iovec system calls, `madvise` and code written through a high alias. The x86-64 Wine
in DroidDeck-Proton carries `ntdll-fixed-allocations-above-host-address-limit.patch` (fixed mappings above
the host limit go to the emulator) and `ntdll-keep-libc-in-native-syscall-dispatch-range.patch` (the
re-armed syscall user dispatch range keeps libc native). Stock x86-64 Proton stops after "Hack native
syscalls" on the same game.
Easy Anti-Cheat's launcher attaches to the game with ptrace, stops it on a `rt_sigprocmask` call, runs its
own loader and restores the registers it saved at the stop. The call then returns `ENOSYS` without writing
the old mask, as it does on a desktop kernel. `ntdll-retry-blocking-signals-dropped-by-a-tracer.patch`
retries the block once when it fails, so Wine never restores an uninitialised mask that blocks `SIGSYS`.
## The container's procfs
Android mounts `/proc` with `hidepid=invisible,gid=3009`, and Easy Anti-Cheat refuses that mount with
launch error 261. Without root, user namespaces or PID namespaces, no procfs instance without those options
can be mounted. Every program in the container runs as the app's user and already sees all of the
container's processes, as it would in a PID-namespaced sandbox on a desktop, so FEX's emulated
`/proc/<pid>/mounts` and `/proc/<pid>/mountinfo` show the proc mount without `hidepid=`, `gid=` and
`subset=` (`tools/fex/patches/0029`). Only x86 programs under FEX see this view; every other line of the
table is the host's. Processes of other Android users stay hidden, as host processes do from a desktop
sandbox.
+4 -3
View File
@@ -216,9 +216,10 @@ alone would then read as an installed client.
NullReferenceException, internal CLR errors). A writable mapping or mprotect now write-protects the
overlapping part of any alias that is already executable, so the first write faults and invalidates.
`FEX_SMCCHECKS=full` was the only workaround; no setting is needed with the patch.
- `0007-cmake-install-code-without-depends`: CMake 4.5 rejects the `DEPENDS` argument FEX passes to
`install(CODE ...)` for the guest thunk libraries, so builds with host thunks stopped at configure.
The guest libraries are external projects in the default build, which `install` already follows.
- `0007-cmake-install-code-without-depends` (`Fixed-upstream: FEX-2612`): CMake 4.5 rejects the
`DEPENDS` argument FEX passes to `install(CODE ...)` for the guest thunk libraries, so builds with
host thunks stopped at configure. The guest libraries are external projects in the default build,
which `install` already follows.
- `0008-signal-return-restores-syscall-state`: a guest `rt_sigreturn` is a system call, so FEX's
syscall stub marks every static register as spilled (`InSyscallInfo = 0xFFFF`). When the handler
left RIP alone, the return resumed the interrupted JIT code without passing the stub's reset, and