From: Jan Beulich Date: Thu, 2 Mar 2017 15:08:27 +0000 (+0100) Subject: x86emul: correct decoding of vzero{all,upper} X-Git-Tag: archive/raspbian/4.11.1-1+rpi1~1^2~66^2~2592 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=26735f30dffe1091686bbe921aacbea8ba371cc8;p=xen.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 --- diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c index a65026a3b6..667049df2f 100644 --- a/xen/arch/x86/x86_emulate/x86_emulate.c +++ b/xen/arch/x86/x86_emulate/x86_emulate.c @@ -2375,12 +2375,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;