WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] gdbsx: use MTF flag for HVM guests for single step

To: "Xen-devel@xxxxxxxxxxxxxxxxxxx" <Xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] gdbsx: use MTF flag for HVM guests for single step
From: Mukesh Rathor <mukesh.rathor@xxxxxxxxxx>
Date: Fri, 3 Sep 2010 17:06:46 -0700
Cc:
Delivery-date: Fri, 03 Sep 2010 17:08:03 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: Oracle Corporation
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
The attached patch first tries the MTF flag for HVM guest
single step, reverting to manually setting the TF flag  if MTF fails.

Tested on 4.0.1. Compile tested on unstable.

thanks,
Mukesh

Signed-off-by: mukesh.rathor@xxxxxxxxxx

diff -r 1831912d4109 tools/debugger/gdbsx/xg/xg_main.c
--- a/tools/debugger/gdbsx/xg/xg_main.c Thu Sep 02 19:12:42 2010 +0100
+++ b/tools/debugger/gdbsx/xg/xg_main.c Fri Sep 03 17:03:05 2010 -0700
@@ -158,6 +158,7 @@
 
 
 /*
+ * Precondition: domctl global struct must be filled 
  * Returns : 0 Success, failure otherwise with errno set
  */
 static int
@@ -366,6 +367,19 @@
     union vcpu_guest_context_any anyc;
     int sz = sizeof(anyc);
 
+    /* first try the MTF for hvm guest. otherwise do manually */
+    if (_hvm_guest) {
+        domctl.u.debug_op.vcpu = which_vcpu;
+        domctl.u.debug_op.op = setit ? XEN_DOMCTL_DEBUG_OP_SINGLE_STEP_ON :
+                                       XEN_DOMCTL_DEBUG_OP_SINGLE_STEP_OFF;
+
+        if (_domctl_hcall(XEN_DOMCTL_debug_op, NULL, 0) == 0) {
+            XGTRC("vcpu:%d:MTF success setit:%d\n", which_vcpu, setit);
+            return 0;
+        }
+        XGTRC("vcpu:%d:MTF failed. setit:%d\n", which_vcpu, setit);
+    }
+
     memset(&anyc, 0, sz);
     domctl.u.vcpucontext.vcpu = (uint16_t)which_vcpu;
     set_xen_guest_handle(domctl.u.vcpucontext.ctxt, &anyc.ctxt);


Attachment: gdbsx.out
Description: Binary data

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] gdbsx: use MTF flag for HVM guests for single step, Mukesh Rathor <=