Windows: Introduce a FEX unixlib and use for all linux syscalls#5424
Windows: Introduce a FEX unixlib and use for all linux syscalls#5424bylaws wants to merge 2 commits into
Conversation
|
updated |
|
|
||
| FEXCore::Allocator::HookPtrs Ptrs {}; | ||
|
|
||
| // Wine will soon require us to use unixlib for calling helper routines that use Linux syscalls. |
There was a problem hiding this comment.
Could you double-check that the context/background provided in the original comments isn't just dropped (to the extent that it still applies)? The new comments are very sparse, and it seems easy enough to avoid repeating the lengthy conversation we had to produce the original comment.
There was a problem hiding this comment.
I don't think any of it is really meaningful to have as a code comment tbh, the comment exists to justify a codepath that no longer exists
There was a problem hiding this comment.
// Wine will soon require us to use unixlib for calling helper routines that use Linux syscalls.
// It needs this for userspace syscall dispatch to capture rogue applications doing raw Windows syscalls.
That's the least bit that's still relevant context. Probably makes sense to reword it with the new implementation, but without this context the code begs the same questions we went through when adding this code initially (see discussion over there, trying to avoid repeating it here since adapting existing comments doesn't take that much time).
|
updated |
|
Since this is primarily authored by AI tools, I'm going to need to spend extra effort reviewing this PR, which is why I've been putting it off. |
| Dispatcher = *DispatcherPtr; | ||
| #endif | ||
|
|
||
| if (NtQueryVirtualMemory(NtCurrentProcess(), &__ImageBase, MemoryWineUnixFuncs, &UnixlibHandle, sizeof(UnixlibHandle), nullptr)) { |
There was a problem hiding this comment.
Current Wine has MemoryWineLoadUnixLibByName, which allows passing unixlib name. With that, it should be possible to share unixlib among wow64 and arm64ec builds. We may backport that to Proton if needed.
There was a problem hiding this comment.
Oh nice, that's much cleaner will switch :)
|
This is now implemented through a series of non-LLM related PRs, and I even understand it now. |
This avoids the ever increasing need to expose obscure or fex-specific linux features in wine patches and instead allows FEX to run its own linux code nicely - this could pave way for faster sigbus handling or smc (with far too much effort to the degree i think it's still a bad idea over hashing)
This is somewhat of a breaking change in that wine fex users will also need to install the unixlibs for full functionality, but seems far better in long-run.
Needs testing with shm stats and madvise naming to confirm it still works though before merging.
Mostly authored by claude, which is much better now than jan I must say