Currently usr1_handler always delivers the context to server. With AVX enabled the single context size is around 1k (while there are two of those for wow64). I am now working on a more generic xstate support in contexts (mostly motivated by AVX512), with AVX512 the single context to be transferred to server is ~1k bigger.
The context is needed to be passed to the server from usr1_handler only for NtGetContextThread, NtSetContextThread and NtSuspendThread handling (e. g., when stop_thread is called on the server). The vast majority of usr1_handler usage is for kernel APCs (e. g., APC_ASYNC_IO involved in every async operation) that don't need the thread context transferred to the server and back.
My measurements of single SERVER_START_REQ( select ) in server_select() shows that the turnaround time of the request with the context (on native x64 without wow context) is almost two times bigger on average when currently supported AVX context is involved (that is, on every usr1_handle invocation on a machine supporting AVX). So, this patch is expected to increase the time of relatively rare calls which actually need contexts by roughly 50% but decrease the turnaround time of frequent calls involving system APCs by 50%. The difference will be more in favour of this patch once huge AVX512 contexts are added.
--
v2: ntdll: Avoid sending context in wait_suspend() when not required.
https://gitlab.winehq.org/wine/wine/-/merge_requests/4914
This is relevant to the structuriser because branched DXIL can sometimes contain forward refs. It doesn't need to be implemented in the backend until necessary, but it adds a parameter to `register_init_ssa_vector()` and `register_init_ssa_scalar()` so it's convenient to add before further use of those functions.
--
v3: vkd3d-shader/dxil: Support forward-referenced value ids.
https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/590
Checking flags of the thread desktop to determine whether virtual desktop is on is unreliable.
For example, CEF applications create their own desktop and so is_virtual_desktop() could incorrectly
report that virtual desktop is off.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55810
--
v4: server: inherit wine internal desktop flags when creating desktops.
https://gitlab.winehq.org/wine/wine/-/merge_requests/4786
This reworks `set_native_thread_name()` for macOS to not rely on mach thread ports returned server side (which were potentially colliding cross-process anyways) and re-implements what `pthread_setname_np()` would do on wines side, with additionally allowing setting threadnames cross-process.
On the kernel side `bsd_setthreadname()` is apparently "known to race with regards to the contents of the thread name", so that is only exposed for the thread calling it on itself.
Since the pthread struct is private, the location of the thread name is determined at runtime (although in practice, it is constant (80 bytes) from at least 10.15 up to 14.0).
This has an effect on both `pthread_getname_np()` and the `NSThread` implementation on top a native library would use.
Cross-thread naming is only not visible to external debuggers, which have acquired a mach port right and calling `thread_info()` with `THREAD_EXTENDED_INFO`
--
v2: ntdll: Reimplement set_native_thread_name() for macOS.
https://gitlab.winehq.org/wine/wine/-/merge_requests/4854
This series' main purpose is to fix the handles' attributes
of standard I/O handles in CreateProcess.
Needed behavior in CreateProcess is implemented by supporting
the DUPLICATE_SAME_ATTRIBUTES option in NtDuplicateObject() and
DuplicateHandle().
This option is not documented in SDK, but is in DDK.
Manifest constant has been added to DDK header (maybe now
Wine's DUPLICATE_MAKE_GLOBAL could be moved here to).
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/4613