Do not hardcode bit 1.
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
---
target/i386/xsave_helper.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/target/i386/xsave_helper.c b/target/i386/xsave_helper.c
index 1fa3133b1a2..666a2810029 100644
--- a/target/i386/xsave_helper.c
+++ b/target/i386/xsave_helper.c
@@ -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 */
--
2.55.0