aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/asm-x86/xstate.h
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2011-11-18 09:22:45 +0100
committerJan Beulich <jbeulich@suse.com>2011-11-18 09:22:45 +0100
commit04678eb8f30a83620fa2c960431dfe4fb40d86f2 (patch)
treec2caef081e1024ab7b765435f108b025f5aa12aa /xen/include/asm-x86/xstate.h
parent8eca0db0e836a081d873de7e9eefb3763f065780 (diff)
downloadxen-04678eb8f30a83620fa2c960431dfe4fb40d86f2.tar.gz
xen-04678eb8f30a83620fa2c960431dfe4fb40d86f2.tar.bz2
xen-04678eb8f30a83620fa2c960431dfe4fb40d86f2.zip
x86/xsave: provide guests with finit-like environment
Without the use of xsave, guests get their initial floating point environment set up with finit. At least NetWare actually depends on this (in particular on all exceptions being masked), so to be consistent set the same environment also when using xsave. This is also in line with all SSE exceptions getting masked initially. To avoid further fragile casts in xstate_alloc_save_area() the patch also changes xsave_struct's fpu_see member to have actually usable fields. The patch was tested in its technically identical, but modified-file- wise different 4.1.2 version. Signed-off-by: Jan Beulich <jbeulich@suse.com> Tested-by: Charles Arnold <carnold@suse.com> Acked-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/include/asm-x86/xstate.h')
-rw-r--r--xen/include/asm-x86/xstate.h27
1 files changed, 26 insertions, 1 deletions
diff --git a/xen/include/asm-x86/xstate.h b/xen/include/asm-x86/xstate.h
index 2ff495b226..90e405ef1a 100644
--- a/xen/include/asm-x86/xstate.h
+++ b/xen/include/asm-x86/xstate.h
@@ -11,6 +11,9 @@
#include <xen/types.h>
#include <xen/percpu.h>
+#define FCW_DEFAULT 0x037f
+#define MXCSR_DEFAULT 0x1f80
+
#define XSTATE_CPUID 0x0000000d
#define XSTATE_FEATURE_XSAVEOPT (1 << 0) /* sub-leaf 1, eax[bit 0] */
@@ -46,7 +49,29 @@ extern u64 xfeature_mask;
/* extended state save area */
struct xsave_struct
{
- struct { char x[512]; } fpu_sse; /* FPU/MMX, SSE */
+ union { /* FPU/MMX, SSE */
+ char x[512];
+ struct {
+ uint16_t fcw;
+ uint16_t fsw;
+ uint8_t ftw;
+ uint8_t rsvd1;
+ uint16_t fop;
+ union {
+#ifdef __x86_64__
+ uint64_t addr;
+#endif
+ struct {
+ uint32_t offs;
+ uint16_t sel;
+ uint16_t rsvd;
+ };
+ } fip, fdp;
+ uint32_t mxcsr;
+ uint32_t mxcsr_mask;
+ /* data registers follow here */
+ };
+ } fpu_sse;
struct {
u64 xstate_bv;