--
v2: winevulkan: Avoid converting unexposed extensions structs.
winevulkan: Enumerate struct extensions with the registry structs.
winevulkan: Build the struct extension list lazily.
winevulkan: Simplify struct conversion enumeration.
winevulkan: Order the win32 structs as other structs.
https://gitlab.winehq.org/wine/wine/-/merge_requests/8901
On Wed Sep 3 15:12:53 2025 +0000, Christian Tinauer wrote:
> changed this line in [version 2 of the diff](/wine/wine/-/merge_requests/8894/diffs?diff_id=205547&start_sha=a38d27fbc01002ca53b5c64949790f1a0a326477#25828ec85937a729c394182abf50faf3f08c268f_6193_6193)
Reverted.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/8894#note_114849
On Wed Sep 3 15:12:52 2025 +0000, Christian Tinauer wrote:
> changed this line in [version 2 of the diff](/wine/wine/-/merge_requests/8894/diffs?diff_id=205547&start_sha=a38d27fbc01002ca53b5c64949790f1a0a326477#b1df58feb3444ad26c675cfa6fe51c306a9dfedc_1398_1398)
Reverted.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/8894#note_114848
On Wed Sep 3 15:12:52 2025 +0000, Christian Tinauer wrote:
> changed this line in [version 2 of the diff](/wine/wine/-/merge_requests/8894/diffs?diff_id=205547&start_sha=a38d27fbc01002ca53b5c64949790f1a0a326477#85309c8ce7c9487572d2f5c6bde361a8bb004951_3315_3315)
Done.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/8894#note_114847
I saw a crash when Unix code would try to execute a NULL function pointer: while handling the SEGV `check_invalid_gsbase()` would try to deference `%rip` which is of course NULL.
This was only seen on macOS because the initial `if (cur_gsbase == (ULONG_PTR)teb)` check will never be equal, since there's no way [1] to find what GSBASE was when the signal was raised. macOS uses `%gs` for it's own thread-local storage, and we have to reset GSBASE to the Mac TSD in `init_handler()` before anything else runs.
This means that every page fault will result in reading from `%rip`, and `virtual_uninterrupted_read_memory()` must be used in case `%rip` isn't a valid address.
I also added some comments to explain the lack of a Mac codepath for getting/setting GSBASE.
With this commit and testing with the sample code in #57444, I found that on Intel Macs `check_invalid_gsbase()` is necessary and works correctly. Rosetta does not implement resetting GSBASE on a `pop %gs` though, so `check_invalid_gsbase()` isn't necessary there.
I do worry slightly about the overhead of calling `virtual_uninterrupted_read_memory()` for every page fault; if that ever needs to be reduced, skipping `check_invalid_gsbase()` on Rosetta would be a first step.
[1]: This is mostly but not completely true--when a user LDT is installed (i.e. wow64), macOS uses a larger "full" sigcontext that includes the value of GSBASE. But Rosetta doesn't implement this, so it's only useful on Intel Macs. And if we wanted to use it on Intel Macs, we would need to always install a user LDT.
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/8899