[PATCH] ntdll/tests: Fix the XState AllFeatureSize check on old CPUs.

Francois Gouget fgouget at codeweavers.com
Fri May 28 11:12:34 CDT 2021


On old CPUs lacking XSAVEC, Windows 8+ does not set AllFeatureSize and
AllFeatures.

Wine-Bug: https://bugs.winehq.org//show_bug.cgi?id=51188
Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
As per the comment and commit message, my understanding is that this is 
tied to the XSAVEC support in the CPU.

I removed broken() to match the xstate.AllFeatures check.
But I'm also fine with having either or both with broken(): I don't 
know what we want / can do in Wine for this.

This should fix the Windows 8.1 failures on cw-gtx560 and cw-rx460:
https://test.winehq.org/data/patterns.html#ntdll:virtual
---
 dlls/ntdll/tests/virtual.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/dlls/ntdll/tests/virtual.c b/dlls/ntdll/tests/virtual.c
index e657a424fcd..5f155b1a147 100644
--- a/dlls/ntdll/tests/virtual.c
+++ b/dlls/ntdll/tests/virtual.c
@@ -952,12 +952,14 @@ static void test_user_shared_data(void)
         ok(xstate.OptimizedSave, "Got zero OptimizedSave with compaction enabled.\n");
     ok(!xstate.AlignedFeatures, "Got unexpected AlignedFeatures %s.\n",
             wine_dbgstr_longlong(xstate.AlignedFeatures));
-    ok(xstate.AllFeatureSize >= 512 + sizeof(XSTATE), "Got unexpected AllFeatureSize %u.\n",
-            xstate.AllFeatureSize);
+    ok(xstate.AllFeatureSize >= 512 + sizeof(XSTATE)
+            || !xstate.AllFeatureSize /* win8 on CPUs without XSAVEC */,
+            "Got unexpected AllFeatureSize %u.\n", xstate.AllFeatureSize);
 
     for (i = 0; i < ARRAY_SIZE(feature_sizes); ++i)
     {
-        ok(xstate.AllFeatures[i] == feature_sizes[i] || !xstate.AllFeatures[i],
+        ok(xstate.AllFeatures[i] == feature_sizes[i]
+                || !xstate.AllFeatures[i] /* win8+ on CPUs without XSAVEC */,
                 "Got unexpected AllFeatures[%u] %u, expected %u.\n", i,
                 xstate.AllFeatures[i], feature_sizes[i]);
         ok(xstate.Features[i].Size == feature_sizes[i], "Got unexpected Features[%u].Size %u, expected %u.\n", i,
-- 
2.20.1




More information about the wine-devel mailing list