]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
x86/XSTATE: clarify XRSTOR() macro
authorJan Beulich <jbeulich@suse.com>
Thu, 9 Jun 2016 13:45:23 +0000 (15:45 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 9 Jun 2016 13:45:23 +0000 (15:45 +0200)
Make obvious that xcomp_bv is expected to be clear when we get here
with XSTATE_COMPACTION_ENABLED not set.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by Andrew Cooper <andrew.cooper3@citrix.com>

xen/arch/x86/xstate.c

index 1fd1ce8c244495f50b65009612143ad23e07b20a..d90e89ed0aef3e084c25ccf81d851afb9d97bea0 100644 (file)
@@ -387,8 +387,11 @@ void xrstor(struct vcpu *v, uint64_t mask)
         { \
             if ( unlikely(!(ptr->xsave_hdr.xcomp_bv & \
                             XSTATE_COMPACTION_ENABLED)) ) \
-                ptr->xsave_hdr.xcomp_bv |= ptr->xsave_hdr.xstate_bv | \
-                                           XSTATE_COMPACTION_ENABLED; \
+            { \
+                ASSERT(!ptr->xsave_hdr.xcomp_bv); \
+                ptr->xsave_hdr.xcomp_bv = ptr->xsave_hdr.xstate_bv | \
+                                          XSTATE_COMPACTION_ENABLED; \
+            } \
             _xrstor(pfx "0x0f,0xc7,0x1f"); /* xrstors */ \
         } \
         else \