direct-io.hg

changeset 11680:2d155d41fe46

[HVM] Add sub instruction support to HVM MMIO decoder.
This is needed for SMP PAE windows XP SP2.

Signed-off-by: Xin Li <xin.b.li@intel.com>
author kaf24@firebug.cl.cam.ac.uk
date Sat Sep 30 11:08:41 2006 +0100 (2006-09-30)
parents a949bd6ceb85
children 96a6649fa691
files xen/arch/x86/hvm/io.c xen/arch/x86/hvm/platform.c xen/include/asm-x86/hvm/io.h
line diff
     1.1 --- a/xen/arch/x86/hvm/io.c	Sat Sep 30 10:49:08 2006 +0100
     1.2 +++ b/xen/arch/x86/hvm/io.c	Sat Sep 30 11:08:41 2006 +0100
     1.3 @@ -596,6 +596,7 @@ static void hvm_mmio_assist(struct cpu_u
     1.4          break;
     1.5  
     1.6      case INSTR_CMP:
     1.7 +    case INSTR_SUB:
     1.8          if (src & REGISTER) {
     1.9              index = operand_index(src);
    1.10              value = get_reg_value(size, index, 0, regs);
    1.11 @@ -607,6 +608,8 @@ static void hvm_mmio_assist(struct cpu_u
    1.12              index = operand_index(dst);
    1.13              value = get_reg_value(size, index, 0, regs);
    1.14              diff = value - (unsigned long) p->u.data;
    1.15 +            if ( mmio_opp->instr == INSTR_SUB )
    1.16 +                set_reg_value(size, index, 0, regs, diff);
    1.17          }
    1.18  
    1.19          /*
     2.1 --- a/xen/arch/x86/hvm/platform.c	Sat Sep 30 10:49:08 2006 +0100
     2.2 +++ b/xen/arch/x86/hvm/platform.c	Sat Sep 30 11:08:41 2006 +0100
     2.3 @@ -394,6 +394,11 @@ static int hvm_decode(int realmode, unsi
     2.4          GET_OP_SIZE_FOR_NONEBYTE(instr->op_size);
     2.5          return mem_reg(instr->op_size, opcode, instr, rex);
     2.6  
     2.7 +    case 0x2B: /* sub m32/16, r32/16 */
     2.8 +        instr->instr = INSTR_SUB;
     2.9 +        GET_OP_SIZE_FOR_NONEBYTE(instr->op_size);
    2.10 +        return mem_reg(instr->op_size, opcode, instr, rex);
    2.11 +
    2.12      case 0x30: /* xor r8, m8 */
    2.13          instr->instr = INSTR_XOR;
    2.14          instr->op_size = BYTE;
    2.15 @@ -1011,6 +1016,7 @@ void handle_mmio(unsigned long va, unsig
    2.16  
    2.17      case INSTR_CMP:        /* Pass through */
    2.18      case INSTR_TEST:
    2.19 +    case INSTR_SUB:
    2.20          mmio_opp->flags = mmio_inst.flags;
    2.21          mmio_opp->instr = mmio_inst.instr;
    2.22          mmio_opp->operand[0] = mmio_inst.operand[0]; /* source */
     3.1 --- a/xen/include/asm-x86/hvm/io.h	Sat Sep 30 10:49:08 2006 +0100
     3.2 +++ b/xen/include/asm-x86/hvm/io.h	Sat Sep 30 11:08:41 2006 +0100
     3.3 @@ -68,6 +68,7 @@
     3.4  #define INSTR_TEST  12
     3.5  #define INSTR_BT    13
     3.6  #define INSTR_XCHG  14
     3.7 +#define INSTR_SUB   15
     3.8  
     3.9  struct instruction {
    3.10      __s8    instr;        /* instruction type */