Followup to 03039ab2ee.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=58335
If I observed it right we currently leave `init_xstate_features` on older computers with EnabledFeatures being zero. This leads in `__wine_syscall_dispatcher` to getting the xsave64 getting called with "$rax = 0x0", therefore e.g. xmm6 gets not saved to the stack. But later e.g. xmm6 gets restored from stack in `__wine_syscall_dispatcher` (see [](https://gitlab.winehq.org/wine/wine/-/blob/wine-10.12/dlls/ntdll/unix/signal...))
From: Bernhard Übelacker bernhardu@mailbox.org
Followup to 03039ab2ee.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=58335 --- dlls/ntdll/unix/system.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c index e486da40691..e8758a3df6d 100644 --- a/dlls/ntdll/unix/system.c +++ b/dlls/ntdll/unix/system.c @@ -436,10 +436,10 @@ static void init_xstate_features( XSTATE_CONFIGURATION *xstate ) TRACE( "XSAVE details %#x, %#x, %#x, %#x.\n", regs[0], regs[1], regs[2], regs[3] ); supported_mask = ((ULONG64)regs[3] << 32) | regs[0]; supported_mask &= do_xgetbv(0) & supported_features; - if (!(supported_mask >> 2)) return;
xstate->EnabledFeatures = (1 << XSTATE_LEGACY_FLOATING_POINT) | (1 << XSTATE_LEGACY_SSE) | supported_mask; xstate->EnabledVolatileFeatures = xstate->EnabledFeatures; + if (!(supported_mask >> 2)) return; xstate->AllFeatureSize = regs[1];
do_cpuid( 0x0000000d, 1, regs );
Limited testing shows that this patch works. What's the reason that it's marked as a draft?
On Fri Jul 18 11:26:43 2025 +0000, Dmitry Timoshkov wrote:
Limited testing shows that this patch works. What's the reason that it's marked as a draft?
The first run of `test-linux-64` failed, so I wanted to check. But a second run succeeded, so I removed the draft state now.
The real question is what does Windows do in this case?
On Fri Jul 18 23:21:29 2025 +0000, Alexandre Julliard wrote:
The real question is what does Windows do in this case?
I don't know if I understand this right. Is the question how Windows fills the `xstate->EnabledFeatures`?
Then one would somehow need to run a Windows at such an ancient machine (I guess a VM could be sufficient with `-cpu host`?) and examine `user_shared_data.XState.EnabledFeatures` (and EnabledVolatileFeatures), by accessing it like in `test_user_shared_data`?