Skip to contentSkip to conversation

Trace cr values in SVM mode

PATCH New George Dunlap 1 participant 1 message Apr 7, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Trace cr values in SVM mode

VMX code handles cr read/writes explicitly, and so the values read / written were easily traced.

In SVM, all cr accesses go through the emulator rather than being handled directly, so no values were traced.

This patch traces values read / written to the cr in the emulator.

(Hoping this will be counted as a "bug fix".)

xen/arch/x86/hvm/emulate.c +3 -0
diff -r 4f99f5f5d66b xen/arch/x86/hvm/emulate.c
@@ -18,6 +18,7 @@
 #include <asm/event.h>
 #include <asm/hvm/emulate.h>
 #include <asm/hvm/hvm.h>
+#include <asm/hvm/trace.h>
 #include <asm/hvm/support.h>
 
 #define HVMTRACE_IO_ASSIST_WRITE 0x200
@@ -749,6 +750,7 @@
     case 3:
     case 4:
         *val = current->arch.hvm_vcpu.guest_cr[reg];
+        HVMTRACE_LONG_2D(CR_READ, reg, TRC_PAR_LONG(*val));
         return X86EMUL_OKAY;
     default:
         break;
@@ -762,6 +764,7 @@
     unsigned long val,
     struct x86_emulate_ctxt *ctxt)
 {
+    HVMTRACE_LONG_2D(CR_WRITE, reg, TRC_PAR_LONG(val));
     switch ( reg )
     {
     case 0:

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel