[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v2 07/16] x86emul: generate and make use of a canonical opcode representation



On 28/09/16 09:12, Jan Beulich wrote:
> @@ -1732,13 +1745,35 @@ x86_decode_twobyte(
>  }
>  
>  static int
> +x86_decode_0f38(
> +    struct x86_emulate_state *state,
> +    struct x86_emulate_ctxt *ctxt,
> +    const struct x86_emulate_ops *ops)
> +{
> +    switch ( ctxt->opcode & X86EMUL_OPC_MASK )
> +    {
> +    case 0x00 ... 0xef:
> +    case 0xf2 ... 0xff:
> +        ctxt->opcode |= MASK_INSR(vex.pfx, X86EMUL_OPC_PFX_MASK);
> +        break;
> +
> +    case 0xf0: case 0xf1: /* movbe / crc32 */
> +        if ( rep_prefix() )
> +            ctxt->opcode |= MASK_INSR(vex.pfx, X86EMUL_OPC_PFX_MASK);
> +        break;
> +    }
> +
> +    return X86EMUL_OKAY;
> +}
> +
> +static int
>  x86_decode(
>      struct x86_emulate_state *state,
>      struct x86_emulate_ctxt *ctxt,
>      const struct x86_emulate_ops  *ops)
>  {
>      uint8_t b, d, sib, sib_index, sib_base;
> -    unsigned int def_op_bytes, def_ad_bytes;
> +    unsigned int def_op_bytes, def_ad_bytes, opcode;
>      int rc = X86EMUL_OKAY;
>  
>      memset(state, 0, sizeof(*state));
> @@ -1819,29 +1854,31 @@ x86_decode(
>  
>      /* Opcode byte(s). */
>      d = opcode_table[b];
> -    if ( d == 0 )
> +    if ( d == 0 && b == 0x0f)

Spaces.

Otherwise, Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.