]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
x86emul: correct {,v}{ld,st}mxcsr handling
authorJan Beulich <jbeulich@suse.com>
Tue, 14 Mar 2017 17:20:27 +0000 (18:20 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 14 Mar 2017 17:20:27 +0000 (18:20 +0100)
Calls to get_fpu() were missing. Calls to put_fpu() are deliberately
not being added: Neither instruction can raise #XM, so the catch-all
_put_fpu() is just fine here.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/x86_emulate/x86_emulate.c

index 0cbeb31db40641039898c5851de6ea3a5aeff074..4872f19c5dd61e366a4756092a24ff43dbd32a45 100644 (file)
@@ -6509,6 +6509,7 @@ x86_emulate(
             vcpu_must_have(sse);
         ldmxcsr:
             generate_exception_if(src.type != OP_MEM, EXC_UD);
+            get_fpu(vex.opcx ? X86EMUL_FPU_ymm : X86EMUL_FPU_xmm, &fic);
             generate_exception_if(src.val & ~mxcsr_mask, EXC_GP, 0);
             asm volatile ( "ldmxcsr %0" :: "m" (src.val) );
             break;
@@ -6518,6 +6519,7 @@ x86_emulate(
             vcpu_must_have(sse);
         stmxcsr:
             generate_exception_if(dst.type != OP_MEM, EXC_UD);
+            get_fpu(vex.opcx ? X86EMUL_FPU_ymm : X86EMUL_FPU_xmm, &fic);
             asm volatile ( "stmxcsr %0" : "=m" (dst.val) );
             break;