vmx realmode: Multiple I/O reads to qemu in an instruction is not
authorKeir Fraser <keir.fraser@citrix.com>
Mon, 28 Jan 2008 11:28:55 +0000 (11:28 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Mon, 28 Jan 2008 11:28:55 +0000 (11:28 +0000)
allowed. But we do allow, for example, a read followed by a write
(e.g., MOVS within video RAM).
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen/arch/x86/hvm/vmx/realmode.c

index b9664ed42c997eeaeecfe2b4f9c0dfd4d3c8e45e..b5952953c4b268031c049662c13644b5a4eff7a6 100644 (file)
@@ -534,12 +534,6 @@ static void realmode_emulate_one(struct realmode_emulate_ctxt *rm_ctxt)
         goto fail;
     }
 
-    if ( io_completed && curr->arch.hvm_vmx.real_mode_io_in_progress )
-    {
-        gdprintk(XENLOG_ERR, "Multiple I/O transactions in a single insn.\n");
-        goto fail;
-    }
-
     if ( rc == X86EMUL_UNHANDLEABLE )
     {
         gdprintk(XENLOG_ERR, "Failed to emulate insn.\n");
@@ -547,7 +541,13 @@ static void realmode_emulate_one(struct realmode_emulate_ctxt *rm_ctxt)
     }
 
     if ( rc == X86EMUL_RETRY )
-        return;
+    {
+        BUG_ON(!curr->arch.hvm_vmx.real_mode_io_in_progress);
+        if ( !io_completed )
+            return;
+        gdprintk(XENLOG_ERR, "Multiple I/O reads in a single insn.\n");
+        goto fail;
+    }
 
     if ( curr->arch.hvm_vmx.real_mode_io_in_progress &&
          (get_ioreq(curr)->vp_ioreq.dir == IOREQ_READ) )