[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [RFC][PATCH 1/1] Add IOREQ_TYPE_VMWARE_PORT




On 09/29/14 07:13, Paolo Bonzini wrote:
Il 26/09/2014 20:51, Don Slutz ha scritto:
+    memcpy(&regs->rax, &vio->io_data, vio->io_size);
Shouldn't this match the code you use below for case
HVMIO_handle_vmport_awaiting_completion?

Nope.  This path is either:

vio->io_state == HVMIO_completed at entry or the the error path
for "If there is no backing DM".  In both cases what to put in rax
is in vio->io_data with vio->io_size set also.

This code comes from hvmemul_do_io().

   -Don Slutz

Paolo

+    return X86EMUL_OKAY;
+}
+
  static int hvmemul_do_io(
      int is_mmio, paddr_t addr, unsigned long *reps, int size,
      paddr_t ram_gpa, int dir, int df, void *p_data)
diff --git a/xen/arch/x86/hvm/io.c b/xen/arch/x86/hvm/io.c
index 9f565d6..96ef3ff 100644
--- a/xen/arch/x86/hvm/io.c
+++ b/xen/arch/x86/hvm/io.c
@@ -206,6 +206,25 @@ void hvm_io_assist(ioreq_t *p)
          else
              memcpy(&guest_cpu_user_regs()->rax, &p->data, vio->io_size);
          break;
+    case HVMIO_handle_vmport_awaiting_completion:
+    {
+        struct cpu_user_regs *regs = guest_cpu_user_regs();
+
+        /* Always zero extension for eax */
+        regs->rax = (uint32_t)(p->addr >> 32);
+        /* Only zero extension if 32bit register changed */
+        if ( (uint32_t)regs->rbx != (uint32_t)p->addr )
+            regs->rbx = (uint32_t)p->addr;
+        if ( (uint32_t)regs->rcx != (uint32_t)p->count )
+            regs->rcx = (uint32_t)p->count;
+        if ( (uint32_t)regs->rdx != (uint32_t)p->size )
+            regs->rdx = (uint32_t)p->size;
+        if ( (uint32_t)regs->rsi != (uint32_t)(p->data >> 32) )
+            regs->rsi = (uint32_t)(p->data >> 32);
+        if ( (uint32_t)regs->rdi != (uint32_t)p->data )
+            regs->rdi = (uint32_t)p->data;
+    }


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.