ia64/xen-unstable

changeset 10917:7e7552112954

[HVM][VMX] Fix dead loop in PIO handling, introduced in c/s 10894.
RIP update is missed for PIO handling.
Signed-off-by: Xin Li <xin.b.li@intel.com>
author kfraser@localhost.localdomain
date Wed Aug 02 15:42:44 2006 +0100 (2006-08-02)
parents ab86a6f3b5ee
children 01734f40860f
files xen/arch/x86/hvm/vmx/vmx.c
line diff
     1.1 --- a/xen/arch/x86/hvm/vmx/vmx.c	Wed Aug 02 15:07:21 2006 +0100
     1.2 +++ b/xen/arch/x86/hvm/vmx/vmx.c	Wed Aug 02 15:42:44 2006 +0100
     1.3 @@ -1111,9 +1111,10 @@ static void vmx_io_instruction(unsigned 
     1.4      memcpy(regs, guest_cpu_user_regs(), HVM_CONTEXT_STACK_BYTES);
     1.5      hvm_store_cpu_guest_regs(current, regs, NULL);
     1.6  
     1.7 -    __vmread(GUEST_RIP, &eip);
     1.8 -    __vmread(GUEST_CS_SELECTOR, &cs);
     1.9 -    __vmread(GUEST_RFLAGS, &eflags);
    1.10 +    eip = regs->eip;
    1.11 +    cs = regs->cs;
    1.12 +    eflags = regs->eflags;
    1.13 +
    1.14      vm86 = eflags & X86_EFLAGS_VM ? 1 : 0;
    1.15  
    1.16      HVM_DBG_LOG(DBG_LEVEL_IO,
    1.17 @@ -1165,7 +1166,7 @@ static void vmx_io_instruction(unsigned 
    1.18                  else
    1.19                      count = (addr & ~PAGE_MASK) / size;
    1.20              } else
    1.21 -                __update_guest_eip(inst_len);
    1.22 +                regs->eip += inst_len;
    1.23  
    1.24              send_pio_req(regs, port, count, size, addr, dir, 1);
    1.25          }
    1.26 @@ -1173,7 +1174,7 @@ static void vmx_io_instruction(unsigned 
    1.27          if (port == 0xe9 && dir == IOREQ_WRITE && size == 1)
    1.28              hvm_print_line(current, regs->eax); /* guest debug output */
    1.29  
    1.30 -        __update_guest_eip(inst_len);
    1.31 +        regs->eip += inst_len;
    1.32          send_pio_req(regs, port, 1, size, regs->eax, dir, 0);
    1.33      }
    1.34  }