Skip to contentSkip to conversation

xentrace: trace interrupt window

PATCH New George Dunlap 1 participant 1 message Dec 4, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xentrace: trace interrupt window

Make a specific interrupt-window trace, with information about why the interrupt in question can't be delivered.

xen/arch/x86/hvm/svm/intr.c +2 -1
diff -r 7338f6301067 xen/arch/x86/hvm/svm/intr.c
@@ -80,7 +80,8 @@
 
     ASSERT(intack.source != hvm_intsrc_none);
 
-    HVMTRACE_2D(INJ_VIRQ, 0x0, /*fake=*/ 1);
+    HVMTRACE_3D(INTR_WINDOW, intack.vector, intack.source,
+                vmcb->eventinj.fields.v?vmcb->eventinj.fields.vector:-1);
 
     /*
      * Create a dummy virtual interrupt to intercept as soon as the
xen/arch/x86/hvm/vmx/intr.c +7 -0
diff -r 7338f6301067 xen/arch/x86/hvm/vmx/intr.c
@@ -73,6 +73,13 @@
     u32 ctl = CPU_BASED_VIRTUAL_INTR_PENDING;
 
     ASSERT(intack.source != hvm_intsrc_none);
+
+    if ( tb_init_done )
+    {
+        unsigned intr = __vmread(VM_ENTRY_INTR_INFO);
+        HVMTRACE_3D(INTR_WINDOW, intack.vector, intack.source,
+                    (intr & INTR_INFO_VALID_MASK) ? intr & 0xff : -1);
+    }
 
     if ( (intack.source == hvm_intsrc_nmi) && cpu_has_vmx_vnmi )
     {
xen/include/asm-x86/hvm/trace.h +1 -0
diff -r 7338f6301067 xen/include/asm-x86/hvm/trace.h
@@ -24,6 +24,7 @@
 #define DO_TRC_HVM_INJ_EXC     DEFAULT_HVM_INJECT
 #define DO_TRC_HVM_INJ_VIRQ    DEFAULT_HVM_INJECT
 #define DO_TRC_HVM_REINJ_VIRQ  DEFAULT_HVM_INJECT
+#define DO_TRC_HVM_INTR_WINDOW DEFAULT_HVM_INJECT
 #define DO_TRC_HVM_IO_READ     DEFAULT_HVM_IO
 #define DO_TRC_HVM_IO_WRITE    DEFAULT_HVM_IO
 #define DO_TRC_HVM_CR_READ     DEFAULT_HVM_REGACCESS
xen/include/public/trace.h +1 -0
diff -r 7338f6301067 xen/include/public/trace.h
@@ -148,6 +148,7 @@
 #define TRC_HVM_CLTS            (TRC_HVM_HANDLER + 0x18)
 #define TRC_HVM_LMSW            (TRC_HVM_HANDLER + 0x19)
 #define TRC_HVM_LMSW64          (TRC_HVM_HANDLER + TRC_64_FLAG + 0x19)
+#define TRC_HVM_INTR_WINDOW     (TRC_HVM_HANDLER + 0X20)
 
 /* trace subclasses for power management */
 #define TRC_PM_FREQ     0x00801000      /* xen cpu freq events */