ia64/xen-unstable

changeset 12578:b0a86eda868a

[HVM] Small fixes to mmio decoder/emulator.

Remove a superfluous special case in xchg and fix word-size source
operand movzx.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
author kfraser@localhost.localdomain
date Mon Nov 27 10:05:23 2006 +0000 (2006-11-27)
parents 97c552510470
children 84c0f49de1b1
files xen/arch/x86/hvm/platform.c
line diff
     1.1 --- a/xen/arch/x86/hvm/platform.c	Mon Nov 27 10:03:35 2006 +0000
     1.2 +++ b/xen/arch/x86/hvm/platform.c	Mon Nov 27 10:05:23 2006 +0000
     1.3 @@ -506,13 +506,16 @@ static int mmio_decode(int realmode, uns
     1.4          GET_OP_SIZE_FOR_NONEBYTE(*op_size);
     1.5          return reg_mem(*op_size, opcode, mmio_op, rex);
     1.6  
     1.7 -    case 0x87:  /* xchg {r/m16|r/m32}, {m/r16|m/r32} */
     1.8 +    case 0x86:  /* xchg m8, r8 */
     1.9 +        mmio_op->instr = INSTR_XCHG;
    1.10 +        *op_size = BYTE;
    1.11 +        GET_OP_SIZE_FOR_BYTE(size_reg);
    1.12 +        return reg_mem(size_reg, opcode, mmio_op, rex);
    1.13 +
    1.14 +    case 0x87:  /* xchg m16/32, r16/32 */
    1.15          mmio_op->instr = INSTR_XCHG;
    1.16          GET_OP_SIZE_FOR_NONEBYTE(*op_size);
    1.17 -        if ( ((*(opcode+1)) & 0xc7) == 5 )
    1.18 -            return reg_mem(*op_size, opcode, mmio_op, rex);
    1.19 -        else
    1.20 -            return mem_reg(*op_size, opcode, mmio_op, rex);
    1.21 +        return reg_mem(*op_size, opcode, mmio_op, rex);
    1.22  
    1.23      case 0x88: /* mov r8, m8 */
    1.24          mmio_op->instr = INSTR_MOV;
    1.25 @@ -655,14 +658,11 @@ static int mmio_decode(int realmode, uns
    1.26          mmio_op->operand[1] = mk_operand(*op_size, index, 0, REGISTER);
    1.27          return DECODE_success;
    1.28  
    1.29 -    case 0xB7: /* movzx m16/m32, r32/r64 */
    1.30 +    case 0xB7: /* movzx m16, r32/r64 */
    1.31          mmio_op->instr = INSTR_MOVZX;
    1.32          GET_OP_SIZE_FOR_NONEBYTE(*op_size);
    1.33          index = get_index(opcode + 1, rex);
    1.34 -        if ( rex & 0x8 )
    1.35 -            mmio_op->operand[0] = mk_operand(LONG, 0, 0, MEMORY);
    1.36 -        else
    1.37 -            mmio_op->operand[0] = mk_operand(WORD, 0, 0, MEMORY);
    1.38 +        mmio_op->operand[0] = mk_operand(WORD, 0, 0, MEMORY);
    1.39          mmio_op->operand[1] = mk_operand(*op_size, index, 0, REGISTER);
    1.40          return DECODE_success;
    1.41