All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Allow debugging of SVM guests with gdbserver-xen
@ 2006-08-25 20:26 Travis Betak
  2006-08-28 10:27 ` Keir Fraser
  0 siblings, 1 reply; 5+ messages in thread
From: Travis Betak @ 2006-08-25 20:26 UTC (permalink / raw)
  To: Keir Fraser; +Cc: xen-devel

Keir,

This patch provides (or at least provided) SVM similar functionality to
what VMX has by allowing source-level debugging of unmodified guests.

I did my development and testing against changeset 11131 and all worked
fine.  However, recent changesets have broken gdbserver-xen's memory
read/write interface with the guest --- at least with respect to SVM
guests.  I haven't examined the problem too closely yet, but I think
this is a side effect from the shadow2 merge.

Anyway, if acceptable, please apply to -unstable.  I'm going to look
at the libxc/ptrace code a little more closely to see if I can root
cause the problem.

   --travis


---


[HVM][SVM] Allow debugging of SVM guests with gdbserver-xen

Signed-off-by: Travis Betak <travis.betak@amd.com>

diff -r bfb710d768eb -r 113730d1bfc5 xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c	Fri Aug 25 11:57:57 2006 -0500
+++ b/xen/arch/x86/hvm/svm/svm.c	Fri Aug 25 11:58:10 2006 -0500
@@ -2705,19 +2705,48 @@ asmlinkage void svm_vmexit_handler(struc

      switch (exit_reason)
      {
+
+#ifdef XEN_DEBUGGER
+
      case VMEXIT_EXCEPTION_DB:
-    {
-#ifdef XEN_DEBUGGER
          svm_debug_save_cpu_user_regs(&regs);
          pdb_handle_exception(1, &regs, 1);
          svm_debug_restore_cpu_user_regs(&regs);
-#else
-        svm_store_cpu_user_regs(&regs, v);
-        domain_pause_for_debugger(); 
-#endif
-    }
-    break;
-
+        break;
+
+    case VMEXIT_EXCEPTION_BP:
+        svm_debug_save_cpu_user_regs(&regs);
+        pdb_handle_exception(3, &regs, 1);
+        svm_debug_restore_cpu_user_regs(&regs);
+        break;
+
+#else /* XEN_DEBUGGER */
+
+    case VMEXIT_EXCEPTION_DB:
+
+        if (test_bit(_DOMF_debugging, &v->domain->domain_flags))
+        {
+            svm_store_cpu_user_regs(&regs, v);
+            domain_pause_for_debugger();
+        }
+        else
+        {
+            svm_inject_exception(v, TRAP_debug, 0, 0);
+        }
+
+        break;
+
+    case VMEXIT_EXCEPTION_BP:
+ 
+        if (test_bit(_DOMF_debugging, &v->domain->domain_flags))
+            domain_pause_for_debugger();
+        else 
+            svm_inject_exception(v, TRAP_int3, 0, 0);
+
+        break;
+
+#endif /* ! XEN_DEBUGGER */
+
      case VMEXIT_NMI:
          do_nmi(&regs, 0);
          break;
@@ -2735,19 +2764,6 @@ asmlinkage void svm_vmexit_handler(struc
          /*
           * Nothing to do, in fact we should never get to this point.
           */
-        break;
-
-    case VMEXIT_EXCEPTION_BP:
-#ifdef XEN_DEBUGGER
-        svm_debug_save_cpu_user_regs(&regs);
-        pdb_handle_exception(3, &regs, 1);
-        svm_debug_restore_cpu_user_regs(&regs);
-#else
-        if ( test_bit(_DOMF_debugging, &v->domain->domain_flags) )
-            domain_pause_for_debugger();
-        else 
-            svm_inject_exception(v, TRAP_int3, 0, 0);
-#endif
          break;

      case VMEXIT_EXCEPTION_NM:

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-10-10 16:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-25 20:26 [PATCH] Allow debugging of SVM guests with gdbserver-xen Travis Betak
2006-08-28 10:27 ` Keir Fraser
2006-08-28 11:06   ` Travis Betak
2006-08-28 11:12     ` Keir Fraser
2006-10-10 16:12       ` Gerd Hoffmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.