]> xenbits.xensource.com Git - people/vhanquez/xen-unstable.git/commitdiff
x86/hvm: put value of emulated register reads into trace records
authorDavid Vrabel <david.vrabel@citrix.com>
Mon, 14 May 2012 15:54:52 +0000 (16:54 +0100)
committerDavid Vrabel <david.vrabel@citrix.com>
Mon, 14 May 2012 15:54:52 +0000 (16:54 +0100)
The tracepoint for emulated MMIO and I/O port reads was always before
the emulated read or write was done.  This means that for reads the
register value in the trace record was always 0.

So for reads, move the tracepoint until the register value is
available.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen/arch/x86/hvm/emulate.c

index 82efd1aa45ac1c0945be47044137ef6caf3e8b76..3a7fe952937de9fb70144ea3f15ad06ba2c03ed1 100644 (file)
@@ -191,7 +191,8 @@ static int hvmemul_do_io(
     p->df = df;
     p->data = value;
 
-    hvmtrace_io_assist(is_mmio, p);
+    if ( dir == IOREQ_WRITE )
+        hvmtrace_io_assist(is_mmio, p);
 
     if ( is_mmio )
     {
@@ -232,6 +233,9 @@ static int hvmemul_do_io(
     }
 
  finish_access:
+    if ( dir == IOREQ_READ )
+        hvmtrace_io_assist(is_mmio, p);
+
     if ( p_data != NULL )
         memcpy(p_data, &vio->io_data, size);