ia64/xen-unstable

changeset 11899:9278ab46ebf2

[HVM] PCmark2005 running in WinXP needs following extension to mmio decoder.

Als fix some inconsistencies, the comments of mmio decoder use AT&T
ordering for operands, but the syntax looks like Intel asm. This leads
to much confusion.

Signed-off-by: Qing He <qing.he@intel.com>
author kfraser@localhost.localdomain
date Thu Oct 19 14:56:02 2006 +0100 (2006-10-19)
parents 266fb767323c
children 8551487a637d
files xen/arch/x86/hvm/platform.c
line diff
     1.1 --- a/xen/arch/x86/hvm/platform.c	Thu Oct 19 14:53:31 2006 +0100
     1.2 +++ b/xen/arch/x86/hvm/platform.c	Thu Oct 19 14:56:02 2006 +0100
     1.3 @@ -367,8 +367,10 @@ static int hvm_decode(int realmode, unsi
     1.4              *op_size = WORD;
     1.5      }
     1.6  
     1.7 +    /* the operands order in comments conforms to AT&T convention */
     1.8 +
     1.9      switch ( *opcode ) {
    1.10 -    case 0x0A: /* or r8, m8 */
    1.11 +    case 0x0A: /* or m8, r8 */
    1.12          mmio_op->instr = INSTR_OR;
    1.13          *op_size = BYTE;
    1.14          GET_OP_SIZE_FOR_BYTE(size_reg);
    1.15 @@ -417,22 +419,28 @@ static int hvm_decode(int realmode, unsi
    1.16          GET_OP_SIZE_FOR_NONEBYTE(*op_size);
    1.17          return reg_mem(*op_size, opcode, mmio_op, rex);
    1.18  
    1.19 -    case 0x32: /* xor m8, r8*/
    1.20 +    case 0x32: /* xor m8, r8 */
    1.21          mmio_op->instr = INSTR_XOR;
    1.22          *op_size = BYTE;
    1.23          GET_OP_SIZE_FOR_BYTE(size_reg);
    1.24          return mem_reg(size_reg, opcode, mmio_op, rex);
    1.25  
    1.26 +    case 0x38: /* cmp r8, m8 */
    1.27 +        mmio_op->instr = INSTR_CMP;
    1.28 +        *op_size = BYTE;
    1.29 +        GET_OP_SIZE_FOR_BYTE(size_reg);
    1.30 +        return reg_mem(size_reg, opcode, mmio_op, rex);
    1.31 +
    1.32      case 0x39: /* cmp r32/16, m32/16 */
    1.33          mmio_op->instr = INSTR_CMP;
    1.34          GET_OP_SIZE_FOR_NONEBYTE(*op_size);
    1.35          return reg_mem(*op_size, opcode, mmio_op, rex);
    1.36  
    1.37 -    case 0x3A: /* cmp r8, r8/m8 */
    1.38 +    case 0x3A: /* cmp m8, r8 */
    1.39          mmio_op->instr = INSTR_CMP;
    1.40          *op_size = BYTE;
    1.41          GET_OP_SIZE_FOR_BYTE(size_reg);
    1.42 -        return reg_mem(size_reg, opcode, mmio_op, rex);
    1.43 +        return mem_reg(size_reg, opcode, mmio_op, rex);
    1.44  
    1.45      case 0x3B: /* cmp m32/16, r32/16 */
    1.46          mmio_op->instr = INSTR_CMP;
    1.47 @@ -480,16 +488,16 @@ static int hvm_decode(int realmode, unsi
    1.48          }
    1.49      }
    1.50  
    1.51 -    case 0x84:  /* test m8, r8 */
    1.52 +    case 0x84:  /* test r8, m8 */
    1.53          mmio_op->instr = INSTR_TEST;
    1.54          *op_size = BYTE;
    1.55          GET_OP_SIZE_FOR_BYTE(size_reg);
    1.56 -        return mem_reg(size_reg, opcode, mmio_op, rex);
    1.57 +        return reg_mem(size_reg, opcode, mmio_op, rex);
    1.58  
    1.59 -    case 0x85: /* text m16/32, r16/32 */
    1.60 +    case 0x85: /* test r16/32, m16/32 */
    1.61          mmio_op->instr = INSTR_TEST;
    1.62          GET_OP_SIZE_FOR_NONEBYTE(*op_size);
    1.63 -        return mem_reg(*op_size, opcode, mmio_op, rex);
    1.64 +        return reg_mem(*op_size, opcode, mmio_op, rex);
    1.65  
    1.66      case 0x87:  /* xchg {r/m16|r/m32}, {m/r16|m/r32} */
    1.67          mmio_op->instr = INSTR_XCHG;