mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-10-14 19:27:09 -04:00
* Force SSBS for a game's Wine: libssbs.so, opt in per game Wine's arm64 signal code resumes threads from a Windows CONTEXT whose Cpsr never carries PSTATE.SSBS, so every signal return leaves the thread running with speculative store bypass disabled - slower on cores such as Oryon. Bannerlator fixes it in its own Wine builds (force_ssbs.diff, Sonicadvance1) and with an LD_PRELOAD adapter for layers it cannot rebuild. DroidDeck's Protons (Valve, GE, CachyOS ARM64) come prebuilt from Steam but run the same aarch64 Wine signal path, so the adapter applies here: tools/linuxfs/ssbs/ssbs_adapter.c, the same source built for glibc (+ sysv_signal), staged to /usr/local/lib/libssbs.so. droiddeck-game-env preloads it when the game's (or the shared) environment sets DROIDDECK_FORCE_SSBS=1, and only into an ARM64 Proton. Off unless asked for: the gain is unproven on Snapdragon 8 Gen 3. For testing: SSBS_ADAPTER_OBSERVE=1 counts without changing anything (the baseline) and SSBS_ADAPTER_DEBUG=1 logs the fixes; both also count signals that ARRIVE while a thread runs without SSBS, which shows whether anything besides signal returns clears it. Checked on an ARM64 Linux kernel: a handler that clears SSBS left 4 of 5 later signals arriving with it clear; with the adapter, 0 of 5. * Force SSBS: a switch under the FEX preset in Steam settings Steam settings > Games gets "Force SSBS" right under the FEX preset, off unless turned on. Like the preset it goes into the game environment's defaults (DROIDDECK_FORCE_SSBS=1), published at once and read by droiddeck-game-env on the next game launch, so a game's own environment can still set it to 0. Measured on the device with the adapter's counters (AYANEO Pocket FIT, DiRT 3 on GE-Proton11-7-aarch64): observing only, 8192 of 8277 signals found the thread running without SSBS; with the adapter, none did - it keeps the bit set everywhere Wine clears it, as a rebuilt ntdll would. The speed-up itself is reported on Oryon cores and was not measurable on the FIT's 8 Gen 3, hence off by default. --------- Co-authored-by: The412Banner <[email protected]>