[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] x86/XSTATE: clarify XRSTOR() macro



commit baabb747749e408030613bdc42ae9f0cbe489ba8
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Thu Jun 9 15:45:23 2016 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Thu Jun 9 15:45:23 2016 +0200

    x86/XSTATE: clarify XRSTOR() macro
    
    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@xxxxxxxx>
    Reviewed-by Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 xen/arch/x86/xstate.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/xstate.c b/xen/arch/x86/xstate.c
index 1fd1ce8..d90e89e 100644
--- a/xen/arch/x86/xstate.c
+++ b/xen/arch/x86/xstate.c
@@ -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 \
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.