aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/domain.c
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2013-07-02 08:41:28 +0200
committerJan Beulich <jbeulich@suse.com>2013-07-02 08:41:28 +0200
commitf9755488bf17c056111d1e442be394cfb63d7788 (patch)
tree224e860b016512cac04f1d67503ad30ea1f391a2 /xen/arch/x86/domain.c
parent7b62e6bd2fcc862360c741cf64d2cbce7825402b (diff)
downloadxen-f9755488bf17c056111d1e442be394cfb63d7788.tar.gz
xen-f9755488bf17c056111d1e442be394cfb63d7788.tar.bz2
xen-f9755488bf17c056111d1e442be394cfb63d7788.zip
x86/xsave: adjust state management
The initial state for a vCPU is using default values, so there's no need to force the XRSTOR to read the state from memory. This saves a couple of thousand restores from memory just during boot of Linux on my Sandy Bridge system (I didn't try to make further measurements). The above requires that arch_set_info_guest() updates the state flags in the save area when valid floating point state got passed in, but that would really have been needed even before in case XSAVE{,OPT} decided to clear one or both of the FP and SSE bits. Furthermore, hvm_vcpu_reset_state() shouldn't just clear out the FPU/ SSE area, but needs to re-initialized MXCSR and FCW. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/arch/x86/domain.c')
-rw-r--r--xen/arch/x86/domain.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 52c9040f59..874742c3b1 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -712,7 +712,11 @@ int arch_set_info_guest(
v->arch.vgc_flags = flags;
if ( flags & VGCF_I387_VALID )
+ {
memcpy(v->arch.fpu_ctxt, &c.nat->fpu_ctxt, sizeof(c.nat->fpu_ctxt));
+ if ( v->arch.xsave_area )
+ v->arch.xsave_area->xsave_hdr.xstate_bv = XSTATE_FP_SSE;
+ }
if ( !compat )
{