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

[Xen-devel] [PATCH 1/5] DEBUG: xentrace: Add debug of HANDLE_PIO



This is not needed.  However I provide it as it is used to generate
data in the cover letter.

Signed-off-by: Don Slutz <dslutz@xxxxxxxxxxx>
---
 tools/xentrace/formats          | 2 ++
 xen/arch/x86/hvm/io.c           | 4 ++++
 xen/include/asm-x86/hvm/trace.h | 2 +-
 xen/include/public/trace.h      | 2 ++
 4 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/tools/xentrace/formats b/tools/xentrace/formats
index da658bf..089022a 100644
--- a/tools/xentrace/formats
+++ b/tools/xentrace/formats
@@ -80,6 +80,8 @@
 0x00082021  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  NPF         [ gpa = 
0x%(2)08x%(1)08x mfn = 0x%(4)08x%(3)08x qual = 0x%(5)04x p2mt = 0x%(6)04x ]
 0x00082023  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  TRAP        [ vector = 
0x%(1)02x ]
 
+0x00082040  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  HANDLE_PIO [ port = 0x%(1)04x 
size = %(2)d dir = %(3)d io_state = %(4)d ret = %(5)d ]
+
 0x0010f001  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  page_grant_map      [ domid = 
%(1)d ]
 0x0010f002  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  page_grant_unmap    [ domid = 
%(1)d ]
 0x0010f003  CPU%(cpu)d  %(tsc)d (+%(reltsc)8d)  page_grant_transfer [ domid = 
%(1)d ]
diff --git a/xen/arch/x86/hvm/io.c b/xen/arch/x86/hvm/io.c
index 68fb890..8584d96 100644
--- a/xen/arch/x86/hvm/io.c
+++ b/xen/arch/x86/hvm/io.c
@@ -155,7 +155,10 @@ int handle_pio(uint16_t port, unsigned int size, int dir)
         break;
     case X86EMUL_RETRY:
         if ( vio->io_state != HVMIO_awaiting_completion )
+        {
+            HVMTRACE_5D(HANDLE_PIO, port, size, dir, vio->io_state, 0);
             return 0;
+        }
         /* Completion in hvm_io_assist() with no re-emulation required. */
         ASSERT(dir == IOREQ_READ);
         vio->io_state = HVMIO_handle_pio_awaiting_completion;
@@ -166,6 +169,7 @@ int handle_pio(uint16_t port, unsigned int size, int dir)
         break;
     }
 
+    HVMTRACE_5D(HANDLE_PIO, port, size, dir, vio->io_state, 1);
     return 1;
 }
 
diff --git a/xen/include/asm-x86/hvm/trace.h b/xen/include/asm-x86/hvm/trace.h
index de802a6..32af344 100644
--- a/xen/include/asm-x86/hvm/trace.h
+++ b/xen/include/asm-x86/hvm/trace.h
@@ -54,7 +54,7 @@
 #define DO_TRC_HVM_TRAP             DEFAULT_HVM_MISC
 #define DO_TRC_HVM_TRAP_DEBUG       DEFAULT_HVM_MISC
 #define DO_TRC_HVM_VLAPIC           DEFAULT_HVM_MISC
-
+#define DO_TRC_HVM_HANDLE_PIO  DEFAULT_HVM_MISC
 
 #define TRC_PAR_LONG(par) ((par)&0xFFFFFFFF),((par)>>32)
 
diff --git a/xen/include/public/trace.h b/xen/include/public/trace.h
index 5211ae7..5703551 100644
--- a/xen/include/public/trace.h
+++ b/xen/include/public/trace.h
@@ -228,6 +228,8 @@
 #define TRC_HVM_TRAP_DEBUG       (TRC_HVM_HANDLER + 0x24)
 #define TRC_HVM_VLAPIC           (TRC_HVM_HANDLER + 0x25)
 
+#define TRC_HVM_HANDLE_PIO      (TRC_HVM_HANDLER + 0x40)
+
 #define TRC_HVM_IOPORT_WRITE    (TRC_HVM_HANDLER + 0x216)
 #define TRC_HVM_IOMEM_WRITE     (TRC_HVM_HANDLER + 0x217)
 
-- 
1.8.4


_______________________________________________
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®.