ia64/xen-unstable

changeset 3750:7e23d55c92a3

bitkeeper revision 1.1159.1.557 (4209531dcD_85ru3nT6SL_v6qHidAA)

Subject: [PATCH] mmio-decode-movz.patch

- Handle the movz instruction in the decoder. This was necessary to get
X working.

Signed-off-by: Chengyuan Li <chengyuan.li@intel.com>
Signed-off-by: Arun Sharma <arun.sharma@intel.com>
Signed-off-by: ian@xensource.com
author iap10@labyrinth.cl.cam.ac.uk
date Wed Feb 09 00:02:37 2005 +0000 (2005-02-09)
parents 8518c7b4c3f3
children 0e59227addd8
files xen/arch/x86/vmx_platform.c
line diff
     1.1 --- a/xen/arch/x86/vmx_platform.c	Tue Feb 08 23:57:18 2005 +0000
     1.2 +++ b/xen/arch/x86/vmx_platform.c	Wed Feb 09 00:02:37 2005 +0000
     1.3 @@ -338,7 +338,20 @@ static int vmx_decode(const unsigned cha
     1.4      switch (*inst) {
     1.5                      
     1.6          /* movz */
     1.7 +        case 0xb6:
     1.8 +            index = get_index((inst + 1));
     1.9 +            if (thread_inst->op_size == WORD) {
    1.10 +                thread_inst->operand[1] = mk_operand(WORD, index, 0, REGISTER);
    1.11 +            } else {
    1.12 +                thread_inst->operand[1] = mk_operand(LONG, index, 0, REGISTER);
    1.13 +                
    1.14 +            }
    1.15 +            thread_inst->op_size = BYTE;
    1.16 +            strcpy(thread_inst->i_name, "movzb");
    1.17 +            
    1.18 +            return DECODE_success;
    1.19          case 0xb7:
    1.20 +            thread_inst->op_size = WORD;
    1.21              index = get_index((inst + 1));
    1.22              thread_inst->operand[1] = mk_operand(LONG, index, 0, REGISTER);
    1.23              strcpy(thread_inst->i_name, "movzw");
    1.24 @@ -495,28 +508,15 @@ void handle_mmio(unsigned long va, unsig
    1.25      store_xen_regs(inst_decoder_regs);
    1.26  
    1.27      // Only handle "mov" and "movs" instructions!
    1.28 -    if (!strncmp(mmio_inst.i_name, "movzw", 5)) {
    1.29 -        long value = 0;
    1.30 -        int index;
    1.31 -
    1.32 +    if (!strncmp(mmio_inst.i_name, "movz", 4)) {
    1.33          if (read_from_mmio(&mmio_inst)) {
    1.34              // Send the request and waiting for return value.
    1.35              mpci_p->mmio_target = mmio_inst.operand[1] | WZEROEXTEND;
    1.36 -            mmio_inst.op_size = WORD;       
    1.37 -            send_mmio_req(gpa, &mmio_inst, value, 1, 0);
    1.38 +            send_mmio_req(gpa, &mmio_inst, 0, 1, 0);
    1.39 +            return ;
    1.40          } else {
    1.41 -            // Write to MMIO
    1.42 -            if (mmio_inst.operand[0] & IMMEDIATE) {
    1.43 -                value = mmio_inst.immediate;
    1.44 -            } else if (mmio_inst.operand[0] & REGISTER) {
    1.45 -                index = operand_index(mmio_inst.operand[0]);
    1.46 -                value = get_reg_value(WORD, index, 0, inst_decoder_regs);
    1.47 -            } else {
    1.48 -                domain_crash();
    1.49 -            }
    1.50 -            mmio_inst.op_size = WORD;
    1.51 -            send_mmio_req(gpa, &mmio_inst, value, 0, 0);
    1.52 -            return; 
    1.53 +            printk("handle_mmio - EXIT: movz error!\n");
    1.54 +            domain_crash();
    1.55          }
    1.56      }
    1.57