* [PATCH] x86/XSTATE: clarify XRSTOR() macro
@ 2016-06-08 12:50 Jan Beulich
2016-06-09 12:03 ` Andrew Cooper
2016-06-12 1:26 ` Shuai Ruan
0 siblings, 2 replies; 3+ messages in thread
From: Jan Beulich @ 2016-06-08 12:50 UTC (permalink / raw)
To: xen-devel; +Cc: Andrew Cooper, Shuai Ruan
[-- Attachment #1: Type: text/plain, Size: 899 bytes --]
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>
--- a/xen/arch/x86/xstate.c
+++ b/xen/arch/x86/xstate.c
@@ -387,8 +387,11 @@ void xrstor(struct vcpu *v, uint64_t mas
{ \
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 \
[-- Attachment #2: x86-XSAVES-clarify.patch --]
[-- Type: text/plain, Size: 931 bytes --]
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@suse.com>
--- a/xen/arch/x86/xstate.c
+++ b/xen/arch/x86/xstate.c
@@ -387,8 +387,11 @@ void xrstor(struct vcpu *v, uint64_t mas
{ \
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 \
[-- Attachment #3: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] x86/XSTATE: clarify XRSTOR() macro
2016-06-08 12:50 [PATCH] x86/XSTATE: clarify XRSTOR() macro Jan Beulich
@ 2016-06-09 12:03 ` Andrew Cooper
2016-06-12 1:26 ` Shuai Ruan
1 sibling, 0 replies; 3+ messages in thread
From: Andrew Cooper @ 2016-06-09 12:03 UTC (permalink / raw)
To: Jan Beulich, xen-devel; +Cc: Shuai Ruan
On 08/06/16 13:50, Jan Beulich wrote:
> 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-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] x86/XSTATE: clarify XRSTOR() macro
2016-06-08 12:50 [PATCH] x86/XSTATE: clarify XRSTOR() macro Jan Beulich
2016-06-09 12:03 ` Andrew Cooper
@ 2016-06-12 1:26 ` Shuai Ruan
1 sibling, 0 replies; 3+ messages in thread
From: Shuai Ruan @ 2016-06-12 1:26 UTC (permalink / raw)
To: Jan Beulich; +Cc: xen-devel, Andrew Cooper
On Wed, Jun 08, 2016 at 06:50:56AM -0600, Jan Beulich wrote:
> 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: Shuai Ruan <shuai.ruan@linux.intel.com>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-06-12 1:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-08 12:50 [PATCH] x86/XSTATE: clarify XRSTOR() macro Jan Beulich
2016-06-09 12:03 ` Andrew Cooper
2016-06-12 1:26 ` Shuai Ruan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).