@@ -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 )
@@ -2094,9 +2094,8 @@ static int hvm_load_cpu_ctxt(struct doma
memcpy(v->arch.xsave_area, ctxt.fpu_regs, sizeof(ctxt.fpu_regs));
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;
}
else
memcpy(v->arch.fpu_ctxt, ctxt.fpu_regs, sizeof(ctxt.fpu_regs));
@@ -5455,9 +5454,8 @@ void hvm_vcpu_reset_state(struct vcpu *v
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;
@@ -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