diff options
author | Mukesh Rathor <mukesh.rathor@oracle.com> | 2010-09-07 19:17:16 +0100 |
---|---|---|
committer | Mukesh Rathor <mukesh.rathor@oracle.com> | 2010-09-07 19:17:16 +0100 |
commit | 8b1e566cb2732b0723124a1dd096eda697bbfb3e (patch) | |
tree | 7cf1dad49f6811a4d6025ff7d54162f1378be90c /tools/debugger/gdbsx | |
parent | f6b82709092eaac42b5c892a8f5bbef92614c44a (diff) | |
download | xen-8b1e566cb2732b0723124a1dd096eda697bbfb3e.tar.gz xen-8b1e566cb2732b0723124a1dd096eda697bbfb3e.tar.bz2 xen-8b1e566cb2732b0723124a1dd096eda697bbfb3e.zip |
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@oracle.com
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/debugger/gdbsx')
-rw-r--r-- | tools/debugger/gdbsx/xg/xg_main.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/debugger/gdbsx/xg/xg_main.c b/tools/debugger/gdbsx/xg/xg_main.c index 9cd9fc3a6d..d2eec0b527 100644 --- a/tools/debugger/gdbsx/xg/xg_main.c +++ b/tools/debugger/gdbsx/xg/xg_main.c @@ -158,6 +158,7 @@ xg_init() /* + * Precondition: domctl global struct must be filled * Returns : 0 Success, failure otherwise with errno set */ static int @@ -366,6 +367,19 @@ _change_TF(vcpuid_t which_vcpu, int guest_bitness, int setit) 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); |