[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] tools/debugger/gdbsx: use MTF flag for HVM guests for single step



# HG changeset patch
# User Mukesh Rathor <mukesh.rathor@xxxxxxxxxx>
# Date 1283883436 -3600
# Node ID cd87550cea5e69fda4ae0f7719c3dcfb09dbc40a
# Parent  645b6001935f945ee67bd2e13d257ee5431a5652
tools/debugger/gdbsx: use MTF flag for HVM guests for single step

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.

Signed-off-by: mukesh.rathor@xxxxxxxxxx
Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 tools/debugger/gdbsx/xg/xg_main.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+)

diff -r 645b6001935f -r cd87550cea5e tools/debugger/gdbsx/xg/xg_main.c
--- a/tools/debugger/gdbsx/xg/xg_main.c Tue Sep 07 19:15:24 2010 +0100
+++ b/tools/debugger/gdbsx/xg/xg_main.c Tue Sep 07 19:17:16 2010 +0100
@@ -158,6 +158,7 @@ xg_init()
 
 
 /*
+ * Precondition: domctl global struct must be filled 
  * Returns : 0 Success, failure otherwise with errno set
  */
 static int
@@ -365,6 +366,19 @@ _change_TF(vcpuid_t which_vcpu, int gues
 {
     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;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.