Skip to contentSkip to conversation

Only trace 32-bit EIP when HVM is in 32-bit mode

PATCH In review George Dunlap 1 participant 2 messages Apr 7, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Only trace 32-bit EIP when HVM is in 32-bit mode

Only trace 64 bits when in long mode. This trace happens every VMEXIT, and contributes significantly to trace size. Adding this patch reduces trace size for a parallel xen build by 7%.

(Again, hoping this will be counted as a bug-fix, since no new functionality is introduced.)

#1 lore raw

Attaching the patch this time...
-G

Quoted 9 lines · George Dunlap

Only trace 64 bits when in long mode.  This trace happens every VMEXIT, and contributes significantly to trace size.  Adding this patch reduces trace size for a parallel xen build by 7%.

(Again, hoping this will be counted as a bug-fix, since no new functionality is introduced.)

xen/arch/x86/hvm/svm/svm.c +8 -3
diff -r ce8f37efc992 xen/arch/x86/hvm/svm/svm.c
@@ -1217,9 +1217,14 @@
 
     exit_reason = vmcb->exitcode;
 
-    HVMTRACE_ND(VMEXIT64, 1/*cycles*/, 3, exit_reason,
-                (uint32_t)regs->eip, (uint32_t)((uint64_t)regs->eip >> 32),
-                0, 0, 0);
+    if ( hvm_long_mode_enabled(v) )
+        HVMTRACE_ND(VMEXIT64, 1/*cycles*/, 3, exit_reason,
+                    (uint32_t)regs->eip, (uint32_t)((uint64_t)regs->eip >> 32),
+                    0, 0, 0);
+    else
+        HVMTRACE_ND(VMEXIT, 1/*cycles*/, 2, exit_reason,
+                    (uint32_t)regs->eip, 
+                    0, 0, 0, 0);
 
     if ( unlikely(exit_reason == VMEXIT_INVALID) )
     {
xen/arch/x86/hvm/vmx/vmx.c +8 -3
diff -r ce8f37efc992 xen/arch/x86/hvm/vmx/vmx.c
@@ -2241,9 +2241,14 @@
 
     exit_reason = __vmread(VM_EXIT_REASON);
 
-    HVMTRACE_ND(VMEXIT64, 1/*cycles*/, 3, exit_reason,
-                (uint32_t)regs->eip, (uint32_t)((uint64_t)regs->eip >> 32),
-                0, 0, 0);
+    if ( hvm_long_mode_enabled(v) )
+        HVMTRACE_ND(VMEXIT64, 1/*cycles*/, 3, exit_reason,
+                    (uint32_t)regs->eip, (uint32_t)((uint64_t)regs->eip >> 32),
+                    0, 0, 0);
+    else
+        HVMTRACE_ND(VMEXIT, 1/*cycles*/, 2, exit_reason,
+                    (uint32_t)regs->eip, 
+                    0, 0, 0, 0);
 
     perfc_incra(vmexits, exit_reason);
 

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