From: Jan Beulich Date: Tue, 14 Mar 2017 11:42:58 +0000 (+0100) Subject: x86emul: correct decoding of vzero{all,upper} X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=e26a2a00169bad403c9dcc597218080626cee861;p=people%2Fiwj%2Fxen.git x86emul: correct decoding of vzero{all,upper} These VEX encoded insns aren't followed by a ModR/M byte. Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper master commit: 26735f30dffe1091686bbe921aacbea8ba371cc8 master date: 2017-03-02 16:08:27 +0100 --- diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c index 6fca42753c..a0330a40f1 100644 --- a/xen/arch/x86/x86_emulate/x86_emulate.c +++ b/xen/arch/x86/x86_emulate/x86_emulate.c @@ -2133,12 +2133,21 @@ x86_decode( opcode |= b | MASK_INSR(vex.pfx, X86EMUL_OPC_PFX_MASK); + if ( !(d & ModRM) ) + { + modrm_reg = modrm_rm = modrm_mod = modrm = 0; + break; + } + modrm = insn_fetch_type(uint8_t); modrm_mod = (modrm & 0xc0) >> 6; break; } + } + if ( d & ModRM ) + { modrm_reg = ((rex_prefix & 4) << 1) | ((modrm & 0x38) >> 3); modrm_rm = modrm & 0x07;