]> xenbits.xensource.com Git - xen.git/commitdiff
x86emul: correct decoding of vzero{all,upper}
authorJan Beulich <jbeulich@suse.com>
Tue, 14 Mar 2017 11:42:58 +0000 (12:42 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 14 Mar 2017 11:42:58 +0000 (12:42 +0100)
These VEX encoded insns aren't followed by a ModR/M byte.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
master commit: 26735f30dffe1091686bbe921aacbea8ba371cc8
master date: 2017-03-02 16:08:27 +0100

xen/arch/x86/x86_emulate/x86_emulate.c

index 6fca42753c916a26070961d411405449c9570ee5..a0330a40f1c05ff9afb541309cb346e82aeff2c4 100644 (file)
@@ -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;