mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
x86emul: don't read mask register on AVX512F-incapable platforms
Nor when register state isn't sufficiently enabled. Reported-by: George Dunlap <george.dunlap@citrix.com> Signed-off-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
1 parent
b3c2939fdd
commit
6cb7e52edf
1 file changed
+10
-1
@@ -3557,7 +3557,8 @@ x86_emulate(
|
||||
}
|
||||
|
||||
/* With a memory operand, fetch the mask register in use (if any). */
|
||||
if ( ea.type == OP_MEM && evex.opmsk )
|
||||
if ( ea.type == OP_MEM && evex.opmsk &&
|
||||
_get_fpu(fpu_type = X86EMUL_FPU_opmask, ctxt, ops) == X86EMUL_OKAY )
|
||||
{
|
||||
uint8_t *stb = get_stub(stub);
|
||||
|
||||
@@ -3578,6 +3579,14 @@ x86_emulate(
|
||||
fault_suppression = true;
|
||||
}
|
||||
|
||||
if ( fpu_type == X86EMUL_FPU_opmask )
|
||||
{
|
||||
/* Squash (side) effects of the _get_fpu() above. */
|
||||
x86_emul_reset_event(ctxt);
|
||||
put_fpu(X86EMUL_FPU_opmask, false, state, ctxt, ops);
|
||||
fpu_type = X86EMUL_FPU_none;
|
||||
}
|
||||
|
||||
/* Decode (but don't fetch) the destination operand: register or memory. */
|
||||
switch ( d & DstMask )
|
||||
{
|
||||
|
||||