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

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



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1284394687 -3600
# Node ID 5ca1d7547a42cc469d856b62f1894408ea8e1723
# Parent  16867267ac126043712703455b81c16f2549ee23
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>
xen-unstable changeset:   22115:cd87550cea5e
xen-unstable date:        Tue Sep 07 19:17:16 2010 +0100
---
 tools/debugger/gdbsx/xg/xg_main.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+)

diff -r 16867267ac12 -r 5ca1d7547a42 tools/debugger/gdbsx/xg/xg_main.c
--- a/tools/debugger/gdbsx/xg/xg_main.c Wed Sep 01 10:22:05 2010 +0100
+++ b/tools/debugger/gdbsx/xg/xg_main.c Mon Sep 13 17:18:07 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®.