diff options
author | Wei Huang <wei.huang2@amd.com> | 2011-05-09 11:38:55 +0100 |
---|---|---|
committer | Wei Huang <wei.huang2@amd.com> | 2011-05-09 11:38:55 +0100 |
commit | 0217c28adbb1656e72ce68239eb6092fdc7cde0c (patch) | |
tree | 7ca88d8c8022cdcbeeae5c42a599fe1612400779 /xen/arch/x86/i387.c | |
parent | 3eb0faa4f80653d56e0e74d68872f6d73de23937 (diff) | |
download | xen-0217c28adbb1656e72ce68239eb6092fdc7cde0c.tar.gz xen-0217c28adbb1656e72ce68239eb6092fdc7cde0c.tar.bz2 xen-0217c28adbb1656e72ce68239eb6092fdc7cde0c.zip |
x86/fpu: add mask parameter to xsave and xrstor
Xen currently sets mask bits of xsave() and xrstor() to all 1's. This
patch adds a mask option to xsave() and xrstor().
Signed-off-by: Wei Huang <wei.huang2@amd.com>
Diffstat (limited to 'xen/arch/x86/i387.c')
-rw-r--r-- | xen/arch/x86/i387.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/xen/arch/x86/i387.c b/xen/arch/x86/i387.c index fc0c1c45f4..9350f734d5 100644 --- a/xen/arch/x86/i387.c +++ b/xen/arch/x86/i387.c @@ -35,14 +35,14 @@ static void fpu_init(void) /* FPU Restore Functions */ /*******************************/ /* Restore x87 extended state */ -static inline void fpu_xrstor(struct vcpu *v) +static inline void fpu_xrstor(struct vcpu *v, uint64_t mask) { /* * XCR0 normally represents what guest OS set. In case of Xen itself, * we set all supported feature mask before doing save/restore. */ set_xcr0(v->arch.xcr0_accum); - xrstor(v); + xrstor(v, mask); set_xcr0(v->arch.xcr0); } @@ -98,13 +98,13 @@ static inline void fpu_frstor(struct vcpu *v) /* FPU Save Functions */ /*******************************/ /* Save x87 extended state */ -static inline void fpu_xsave(struct vcpu *v) +static inline void fpu_xsave(struct vcpu *v, uint64_t mask) { /* XCR0 normally represents what guest OS set. In case of Xen itself, * we set all accumulated feature mask before doing save/restore. */ set_xcr0(v->arch.xcr0_accum); - xsave(v); + xsave(v, mask); set_xcr0(v->arch.xcr0); } @@ -174,7 +174,7 @@ void vcpu_restore_fpu(struct vcpu *v) return; if ( xsave_enabled(v) ) - fpu_xrstor(v); + fpu_xrstor(v, XSTATE_ALL); else if ( v->fpu_initialised ) { if ( cpu_has_fxsr ) @@ -204,7 +204,7 @@ void vcpu_save_fpu(struct vcpu *v) clts(); if ( xsave_enabled(v) ) - fpu_xsave(v); + fpu_xsave(v, XSTATE_ALL); else if ( cpu_has_fxsr ) fpu_fxsave(v); else |