x86/xsave: simplify xcomp_bv initialization

This simplifies a number of pointless conditionals: Bits 0 and 1 of
xcomp_bv don't matter anyway, and as long as none of bits 2..62 are
set, setting bit 63 is pointless too unless XSAVES is in use.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
Jan Beulich committed 2016-01-14 10:42:53 +01:00
1 parent a3b6844d3b
commit 83ae0bb226
3 files changed
+7 -10

No files matched your search

+2 -3
View File
@@ -922,9 +922,8 @@ int arch_set_info_guest(
if ( v->arch.xsave_area )
{
v->arch.xsave_area->xsave_hdr.xstate_bv = XSTATE_FP_SSE;
if ( cpu_has_xsaves || cpu_has_xsavec )
v->arch.xsave_area->xsave_hdr.xcomp_bv = XSTATE_FP_SSE |
XSTATE_COMPACTION_ENABLED;
v->arch.xsave_area->xsave_hdr.xcomp_bv =
cpu_has_xsaves ? XSTATE_COMPACTION_ENABLED : 0;
}
}
else if ( v->arch.xsave_area )
+4 -6
View File
@@ -2110,9 +2110,8 @@ static int hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
struct xsave_struct *xsave_area = v->arch.xsave_area;
xsave_area->xsave_hdr.xstate_bv = XSTATE_FP_SSE;
if ( cpu_has_xsaves || cpu_has_xsavec )
xsave_area->xsave_hdr.xcomp_bv = XSTATE_FP_SSE |
XSTATE_COMPACTION_ENABLED;
xsave_area->xsave_hdr.xcomp_bv =
cpu_has_xsaves ? XSTATE_COMPACTION_ENABLED : 0;
}
}
@@ -5476,9 +5475,8 @@ void hvm_vcpu_reset_state(struct vcpu *v, uint16_t cs, uint16_t ip)
if ( v->arch.xsave_area )
{
v->arch.xsave_area->xsave_hdr.xstate_bv = XSTATE_FP;
if ( cpu_has_xsaves || cpu_has_xsavec )
v->arch.xsave_area->xsave_hdr.xcomp_bv = XSTATE_FP |
XSTATE_COMPACTION_ENABLED;
v->arch.xsave_area->xsave_hdr.xcomp_bv =
cpu_has_xsaves ? XSTATE_COMPACTION_ENABLED : 0;
}
v->arch.vgc_flags = VGCF_online;
+1 -1
View File
@@ -272,7 +272,7 @@ int vcpu_init_fpu(struct vcpu *v)
if ( v->arch.xsave_area )
{
v->arch.fpu_ctxt = &v->arch.xsave_area->fpu_sse;
if ( cpu_has_xsaves || cpu_has_xsavec )
if ( cpu_has_xsaves )
v->arch.xsave_area->xsave_hdr.xcomp_bv = XSTATE_COMPACTION_ENABLED;
}
else
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.