Skip to contentSkip to conversation

target/i386: use ESA_FEATURE_ALIGN64_MASK

PATCH In review Paolo Bonzini 2 participants 2 messages Aug 7 – Aug 10

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target/i386: use ESA_FEATURE_ALIGN64_MASK

Do not hardcode bit 1.

---
 target/i386/xsave_helper.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
target/i386/xsave_helper.c +3 -3
index 1fa3133b1a2..666a2810029 100644
@@ -382,7 +382,7 @@ int decompact_xsave_area(const void *buf, size_t buflen, CPUX86State *env)
 
         size = eax;
         dst_off = ebx;
-        align64 = (ecx & (1u << 1)) != 0;
+        align64 = (ecx & ESA_FEATURE_ALIGN64_MASK) != 0;
         supervisor = (ecx & ESA_FEATURE_XSS_MASK) != 0;
 
         /* Component is in the layout but unknown to the guest CPUID model */
@@ -394,7 +394,7 @@ int decompact_xsave_area(const void *buf, size_t buflen, CPUX86State *env)
              */
             host_cpuid(0xD, i, &eax, &ebx, &ecx, &edx);
             size = eax;
-            align64 = (ecx & (1u << 1)) != 0;
+            align64 = (ecx & ESA_FEATURE_ALIGN64_MASK) != 0;
             if (size == 0) {
                 error_report("xsave component %zu: size unknown to both "
                              "guest and host CPUID", i);
@@ -530,7 +530,7 @@ int compact_xsave_area(CPUX86State *env, void *buf, size_t buflen)
         host_cpuid(0xD, i, &eax, &ebx, &ecx, &edx);
         size = eax;
         src_off = ebx;
-        align64 = (ecx >> 1) & 1;
+        align64 = (ecx & ESA_FEATURE_ALIGN64_MASK) != 0;
 
         if (size == 0) {
             /* Component in host xcr0 but unknown - shouldn't happen */
Signature · 1 line
2.55.0