ia64/xen-unstable

changeset 11404:e83368c8d5e2

[HVM] Add a mmio decode for 0F BA /4 for HVM guest.
Signed-off-by: Xiaohui Xin <xiaohui.xin@intel.com>
author kaf24@firebug.cl.cam.ac.uk
date Thu Aug 31 23:59:11 2006 +0100 (2006-08-31)
parents 37e5dfad8425
children e036feb6a4ff
files xen/arch/x86/hvm/io.c xen/arch/x86/hvm/platform.c
line diff
     1.1 --- a/xen/arch/x86/hvm/io.c	Thu Aug 31 23:58:23 2006 +0100
     1.2 +++ b/xen/arch/x86/hvm/io.c	Thu Aug 31 23:59:11 2006 +0100
     1.3 @@ -646,9 +646,13 @@ static void hvm_mmio_assist(struct cpu_u
     1.4          break;
     1.5  
     1.6      case INSTR_BT:
     1.7 -        index = operand_index(src);
     1.8 -        value = get_reg_value(size, index, 0, regs);
     1.9 -
    1.10 +        if ( src & REGISTER )
    1.11 +        {
    1.12 +            index = operand_index(src);
    1.13 +            value = get_reg_value(size, index, 0, regs);
    1.14 +        }
    1.15 +        else if ( src & IMMEDIATE )
    1.16 +            value = mmio_opp->immediate;
    1.17          if (p->u.data & (1 << (value & ((1 << 5) - 1))))
    1.18              regs->eflags |= X86_EFLAGS_CF;
    1.19          else
     2.1 --- a/xen/arch/x86/hvm/platform.c	Thu Aug 31 23:58:23 2006 +0100
     2.2 +++ b/xen/arch/x86/hvm/platform.c	Thu Aug 31 23:59:11 2006 +0100
     2.3 @@ -652,6 +652,23 @@ static int hvm_decode(int realmode, unsi
     2.4          instr->operand[1] = mk_operand(instr->op_size, 0, 0, MEMORY);
     2.5          return DECODE_success;
     2.6  
     2.7 +    case 0xBA:
     2.8 +        if (((opcode[1] >> 3) & 7) == 4) /* BT $imm8, m16/32/64 */
     2.9 +        {
    2.10 +            instr->instr = INSTR_BT;
    2.11 +            GET_OP_SIZE_FOR_NONEBYTE(instr->op_size);
    2.12 +            instr->immediate =
    2.13 +                    (signed char)get_immediate(realmode, opcode+1, BYTE);
    2.14 +            instr->operand[0] = mk_operand(BYTE, 0, 0, IMMEDIATE);
    2.15 +            instr->operand[1] = mk_operand(instr->op_size, 0, 0, MEMORY);
    2.16 +            return DECODE_success;
    2.17 +        }
    2.18 +        else
    2.19 +        {
    2.20 +            printf("0f %x, This opcode subtype isn't handled yet\n", *opcode);
    2.21 +            return DECODE_failure;
    2.22 +        }
    2.23 +
    2.24      default:
    2.25          printf("0f %x, This opcode isn't handled yet\n", *opcode);
    2.26          return DECODE_failure;
    2.27 @@ -1002,10 +1019,17 @@ void handle_mmio(unsigned long va, unsig
    2.28              mmio_opp->operand[0] = mmio_inst.operand[0]; /* bit offset */
    2.29              mmio_opp->operand[1] = mmio_inst.operand[1]; /* bit base */
    2.30  
    2.31 -            index = operand_index(mmio_inst.operand[0]);
    2.32 -            size = operand_size(mmio_inst.operand[0]);
    2.33 -            value = get_reg_value(size, index, 0, regs);
    2.34 -
    2.35 +            if ( mmio_inst.operand[0] & REGISTER )
    2.36 +            { 
    2.37 +                index = operand_index(mmio_inst.operand[0]);
    2.38 +                size = operand_size(mmio_inst.operand[0]);
    2.39 +                value = get_reg_value(size, index, 0, regs);
    2.40 +            }
    2.41 +            else if ( mmio_inst.operand[0] & IMMEDIATE )
    2.42 +            {
    2.43 +                mmio_opp->immediate = mmio_inst.immediate;
    2.44 +                value = mmio_inst.immediate;
    2.45 +            } 
    2.46              send_mmio_req(IOREQ_TYPE_COPY, gpa + (value >> 5), 1,
    2.47                            mmio_inst.op_size, 0, IOREQ_READ, 0);
    2.48              break;