3113 Commits
Author SHA1 Message Date
Ryan Houdek 27cfd41bf9 FEXCore: Wire up the fault free synchronous fault handling
Changes the code generation on arm64ec so the version needs to bump.
2026-10-13 19:55:36 -07:00
Ryan Houdek 07abec317c Arm64ec: Wire up non-faulting synchronous faults 2026-10-13 19:55:33 -07:00
LC fb925d6fc5 Merge pull request #6030 from Sonicadvance1/268
Linux/SignalDelegator: Support SA_RESETHAND
2026-10-12 18:53:32 -04:00
Ryan Houdek dab12ae78e Merge pull request #6020 from javelina-pkwy/fix/main-stack-growth
Linux: Track main stack usage more accurately in VmData
2026-10-12 12:51:37 -07:00
Ryan Houdek e3c1c1e425 Merge pull request #6024 from javelina-pkwy/fix/stat-nullptr
Linux: Return EFAULT for stat() of a null path
2026-10-12 12:49:14 -07:00
Ryan Houdek 0152660af2 Linux/SignalDelegator: Support SA_RESETHAND
This is fairly trivial to support.

Fixes #6028
2026-10-12 12:12:44 -07:00
Justin Becker 30398c371d Clang format 2026-10-09 11:25:10 -07:00
Justin Becker e94ad12400 NIT 2026-10-09 11:24:50 -07:00
Justin Becker 13bc7faee3 Syscall: stat of nullptr shouldn't abort() 2026-10-08 17:01:36 -07:00
Tarik Caramanico 3a2b1c0b43 ARM64EC: Don't read past the end of NtDllRedirectionLUT in CheckCall
NtDllRedirectionLUT has NtDllRedirectionLUTSize entries, so valid
offsets are 0 to NtDllRedirectionLUTSize - 1. The bounds check used
b.hi, which let an offset equal to the size through and read one entry
past the end of the allocation.
2026-10-08 09:35:05 -03:00
Tarik Caramanico 4dbb046d62 ARM64EC: Load NtDllRedirectionLUTSize as 32-bit in CheckCall
NtDllRedirectionLUTSize is a uint32_t, but CheckCall loaded it with a
64-bit ldr. The upper half of the bound then comes from whatever follows
the variable in memory, and the :lo12: offset of a 64-bit ldr needs an
8-byte aligned symbol, so the link fails with "misaligned ldr/str offset"
when the variable ends up on a 4-byte boundary.

Load it with a 32-bit ldr, which zero-extends into x17 for the compare.
2026-10-08 09:24:45 -03:00
Justin Becker 62580ceba0 Linux: Track stack usage more accurately in VmData for RLIMIT_DATA 2026-10-07 11:40:24 -07:00
Ryan Houdek d2b6e371e2 Merge pull request #6008 from Sonicadvance1/265
DiskCache: Support FileID hash with gnu build-id
2026-10-05 11:26:53 -07:00
Ryan Houdek 47be6ad720 Merge pull request #5997 from javelina-pkwy/fix/windows-arm64ec-syscall-stubs
Windows: Don't hardcode NT syscall numbers for ARM64EC
2026-10-05 11:23:39 -07:00
Ryan Houdek e3f402a38a DiskCache: Support FileID hash with gnu build-id
This doesn't fully fix #5912 but gets a step closer. Instead of just
hashing the filename, hash in the build-id as well when it exists.

This isn't all encompassing because the build-id may not exist in all
cases. Crypt Of the Necrodancer for example doesn't ship with the
build-id on their 64-bit build. Although their legacy 32-bit build had
it.

The build-id is always a hash, depending on tool it is either 64-bit or
160-bit in all the executables I found. Although it can be anything so
make sure to be flexible enough to support everything.
2026-10-02 17:38:09 -07:00
Yassin Soliman 1644d185c4 LinuxSyscalls: Preserve argv and path across portable reexec
When binfmt_misc is not visible, execve of an x86 ELF reexecs FEX by path.
That drops the caller-supplied argv[0] and asks the next FEX to reopen the
file through RootFS. Keep the resolved ELF in FEX_EXECVEFD, retain argv[0],
and mark the FD as path-backed so /proc/self/exe stays the real path.
Anonymous memfd execution is unchanged.
2026-10-02 08:45:07 -06:00
Justin Becker 67a7d4b352 NIT: Unneeded ifdef 2026-09-29 12:02:38 -07:00
Justin Becker aad2c969b7 Windows: Don't hardcode NT syscall numbers for ARM64EC 2026-09-29 11:24:36 -07:00
LC 0df84d3844 Merge pull request #5995 from Sonicadvance1/262
Steam: Enable DiskCache by default
2026-09-28 10:12:17 -04:00
Ryan Houdek 63eb604b6c Steam: Enable DiskCache by default 2026-09-28 06:13:03 -07:00
Jacek Caban 517a1836ee ARM64EC: Use correct context flags in ThreadTerm 2026-09-28 10:39:21 +02:00
Jacek Caban b1e54d803b WOW64: Get thread context in BTCpuThreadTerm to make sure the thread is actually suspended 2026-09-28 10:38:29 +02:00
Jacek Caban 4956ac23e5 WOW64: Use correct thread's CPU area in BTCpuThreadTerm
Fixes af04940466.
2026-09-27 23:02:30 +02:00
LC 59f85d6b7d Merge pull request #5992 from Sonicadvance1/261
Windows: On unimplemented print a log
2026-09-25 21:54:39 -04:00
Ryan Houdek dd63548cb1 Windows: On unimplemented print a log
Makes it easier to find which one was missing. Can't use regular log
routines in the header due to conflicting win32 defines.
2026-09-25 14:44:11 -07:00
Ryan Houdek f3b0b41254 Win32: Implement RemoveDirectory 2026-09-25 14:39:55 -07:00
Ryan Houdek 82040bae3e CPUInfo: Adds new AVX extensions 2026-09-19 13:51:30 -07:00
Ryan Houdek ec502b99d8 FEXCore: Support passing process pid to the backend 2026-09-18 16:59:35 -07:00
Ryan Houdek c55fb3b5b8 UnixLib: Add a way to get Linux process PID 2026-09-18 16:58:11 -07:00
Ryan Houdek 37eaff93cb FEXCore: Migrate internal DiskCache header to internal
Leave the smaller public header that is required to get the current
DiskCache version variable still.

NFC
2026-09-15 19:43:27 -07:00
Ryan Houdek 4b652eb91b Merge pull request #5947 from javelina-pkwy/feature/vnni
Implement ISA extension AVX-VNNI
2026-09-11 17:41:32 -07:00
Ryan Houdek f18599d097 Merge pull request #5943 from cjacek/wow64-chpe
WOW64: Use CHPEv2 for suspend and exception support
2026-09-10 16:07:11 -07:00
Justin Becker 89a13cd5fd AVX-VNNI 2026-09-10 15:56:03 -07:00
Ryan Houdek 91bbce5a96 FEXCore/OpcodeDispatcher: Fixes syscall instruction on Linux
I forgot on Linux by default we didn't have the syscall instructions
count as block end. Change this so that it counts as block end now.

This has the additional benefit that now the frontend needs to modify
the RIP manually as well which is fine as it's what arm64ec and wow64
does.

Also add back the UnimplementedOp in RDPID that accidentally got caught
up. Also increment DiskCache version as both changes will change
codegen.

Fixes #5942
2026-09-10 09:50:07 -07:00
Jacek Caban af04940466 WOW64: Use CHPEv2 for suspend and exception support
CHPE_V2_CPU_AREA_INFO is the mechanism used on ARM64EC to coordinate
thread state, suspension and exception handling with the kernel.
It's typically set up by ntdll for ARM64EC processes, but Wine uses
the TEB pointer without restricting where it's coming from. Set
ChpeV2CpuAreaInfo in FEX WOW64 thread initialization.

Fixes 32-bit debug events and a number of CPU context handling tests.
Reduces the number of wineserver round-trips required for suspend and
avoids the need for remote thread creation for inter-process suspends.
2026-09-10 15:30:51 +02:00
Pierre-Loup A. Griffais b5ac608fc5 DiskCache: allow relocations within the same ELF image
We would check the FileID of mapped sections, but BSS is an anonymous mapping.
Grab the ELF image extents when we parse the file, and add an additional check
to the relocation filter to bail out additional relocs if we know that size.
2026-09-09 22:39:50 -07:00
Ryan Houdek 516ce6b15c Threads: Support setting thread names through creation
Gives the DiskCache a thread name so it's easier to find.
2026-09-08 19:11:52 -07:00
Ryan Houdek f79de3c3f9 HostFeatures: Reenable 3DNow! now that it is fixed
With PR #5863, the bug that was breaking rendering in d3dx9 and Fallout
New Vegas is now resolved. This means we can now enable the feature by
default again as all known bugs are resolved.

With 3DNow! and full x87 softfloat enabled in FO:NV inside of the starting house. The game is
running at around 40-43FPS, doing ~22.6 to 34 million soft float
operations per second.

With 3DNow! disabled the game is running 30-31FPS, doing ~24-50 million
softfloat operations per second.

In both cases if x87 reduced precision is enabled then the game is
running at around 108-113FPS with zero softfloat instances getting
counted. Can't see the performance difference at that speed.
2026-09-08 13:12:14 -07:00
Jacek Caban e4c6154be2 WOW64: Use NtRaiseException to raise guest exception
Instead of returning to the currently dispatched exception, which doesn't send a debug event.
2026-09-06 15:22:43 +02:00
Jacek Caban 064a6e96c7 ARM64EC: Use NtRaiseException to raise guest exception
Instead of returning to KiUserExceptionDispatcher, which doesn't send a debug event.
2026-09-06 15:20:30 +02:00
Jacek Caban d704bd3cef Windows: Rise a non-continuable excetpion for STATUS_STACK_BUFFER_OVERRUN 2026-09-06 15:20:30 +02:00
Jacek Caban 9f511d5d78 WOW64: Remove unused variable 2026-09-06 15:20:30 +02:00
Ryan Houdek 179b4423a7 Wine: Change behaviour around SMC and NtReadFile
JIT invalidation around syscalls and kernel calls is mighty fickle.
This is why the previous code path was born. In order to properly handle
this case we need strong coordination between Wine and FEX around
invalidating code and memory protections. This doesn't quite exist today
so we're kind of stuck with a kludge solution. Instead of forcing the
Persona 5 code invalidation on to every process, only do it on P5R.

This fixes a hang in msiexec with PhysX trying to do a blocking read and
jitting code or creating threads, while also maintaining the P5R
approach. The full comment is in the file about the reasoning.
2026-09-04 20:08:18 -07:00
Ryan Houdek 37675e0351 Common/Config: Fixes Cache directory when STEAM_COMPAT_SHADER_PATH on Win32
Moves cache data from %APPDATA% to wherever `STEAM_COMPAT_SHADER_PATH`
points. Turns out this was easier than expected.

Basically moving disk cache from:
- compatdata/<AppID>/pfx/drive_c/users/steamuser/AppData/Local/fex-emu/DiskCache
to:
- shadercache/<AppID>/fex-emu/DiskCache/

Fixes #5913
2026-09-04 14:20:57 -07:00
Justin Becker b03dc847f5 Fix syscall regression 2026-09-03 11:09:19 -07:00
LC 433091c326 Merge pull request #5871 from mcfi/pr5814
Resolve symlinks continuously until we find the actual binary name.
2026-09-01 10:12:49 -04:00
LC a6e74cdbe6 Merge pull request #5889 from Sonicadvance1/224
FEXCore: Removes syscall optimization
2026-08-31 22:47:00 -04:00
Ryan Houdek 66cad978c3 FEXCore: Removes syscall optimization
The JIT was doing a bunch of additional work where it was saving and
restoring registers and then juggling the arguments back in to a stack
frame. All of this is nonsensical without the optimization where we
could call syscalls inline without a stack frame.

Instead remove this optimization entirely and behave like a "generic"
syscall path always. The Linux syscall handler now pulls the arguments
out of the CPU context directly and stores the result back in to RAX
directly as well.

This has knock-on effects where technically syscalls are
going to be slightly faster because no stack frame setup for the
arguments, but additionally we are going to be able to have syscalls be
proper serialization points where we can interrupt the syscall and
long-jump out without problems.

Bumps the DiskCache version again because it causes codegen to change.
2026-08-31 19:23:18 -07:00
Ryan Houdek c11a0cef68 FEXUnixlib: Removes unused variable/warning. 2026-08-31 19:09:24 -07:00
Pierre-Loup A. Griffais c0b24b2f2e DiskCache: on Linux, block signals in Writer thread
Clean up thread flags while we're at it.
2026-08-30 22:27:05 -07:00