]> xenbits.xensource.com Git - xen.git/commitdiff
x86/hvm: always re-emulate I/O from a buffer
authorPaul Durrant <paul.durrant@citrix.com>
Thu, 9 Jul 2015 17:16:00 +0000 (19:16 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 10 Jul 2015 08:20:59 +0000 (10:20 +0200)
If memory mapped I/O is 'chunked' then the I/O must be re-emulated,
otherwise only the first chunk will be processed. This patch makes
sure all I/O from a buffer is re-emulated regardless of whether it
is a read or a write.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/hvm/emulate.c
xen/include/asm-x86/hvm/vcpu.h

index 1444b56f8e8b0d24241d1015d53f6e3cd0647d6f..89b161639ad567f032a5e2045d221f2503445340 100644 (file)
@@ -147,7 +147,7 @@ static int hvmemul_do_io(
              (p.data_is_ptr != data_is_addr) )
             domain_crash(curr->domain);
 
-        if ( data_is_addr || dir == IOREQ_WRITE )
+        if ( data_is_addr )
             return X86EMUL_UNHANDLEABLE;
         goto finish_access;
     default:
@@ -187,7 +187,7 @@ static int hvmemul_do_io(
             rc = hvm_send_assist_req(s, &p);
             if ( rc != X86EMUL_RETRY || curr->domain->is_shutting_down )
                 vio->io_req.state = STATE_IOREQ_NONE;
-            else if ( data_is_addr || dir == IOREQ_WRITE )
+            else if ( data_is_addr )
                 rc = X86EMUL_OKAY;
         }
         break;
index 01cbfe5b08b7eb364d83230d0bb7c30937d10fb1..13ff54f7c214fd38c2410a24097bf94447fda376 100644 (file)
@@ -81,8 +81,7 @@ struct hvm_vcpu_io {
 static inline bool_t hvm_vcpu_io_need_completion(const struct hvm_vcpu_io *vio)
 {
     return (vio->io_req.state == STATE_IOREQ_READY) &&
-           !vio->io_req.data_is_ptr &&
-           (vio->io_req.dir == IOREQ_READ);
+           !vio->io_req.data_is_ptr;
 }
 
 #define VMCX_EADDR    (~0ULL)