Skip to contentSkip to conversation

x86/hvm: put value of emulated register reads into trace records

PATCH New David Vrabel 1 participant 1 message May 10, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/hvm: put value of emulated register reads into trace records

From: David Vrabel <[email protected]>

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.

---
A candidate for 4.0 and 4.1?

---
 xen/arch/x86/hvm/emulate.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
xen/arch/x86/hvm/emulate.c +5 -1
index 82efd1a..3a7fe95 100644
@@ -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);
 
Signature · 1 line
1.7.2.5