* PATCH: add xc_domain_setdebugging in xenctrl API
@ 2007-06-23 17:04 Tristan Gingold
2007-06-23 17:04 ` Keir Fraser
2007-07-02 18:13 ` Alex Williamson
0 siblings, 2 replies; 3+ messages in thread
From: Tristan Gingold @ 2007-06-23 17:04 UTC (permalink / raw)
To: xen-devel, Xen-ia64-devel, Alex Williamson
[-- Attachment #1: Type: text/plain, Size: 436 bytes --]
Hi,
for ia64, I'd like to add xc_domain_setdebugging() in the xenctrl API.
This patch implements it and modifies xc_ptrace.c to use it.
The rationnal is enabling debugging tool not based on the ptrace API.
The ptrace API is based on Linux ptrace which (at least on ia64) doesn't
have many privilegied registers.
I'd prefer this patch being integrated on xen-ia64-unstable tree but we
need the OK from non-ia64 maintainers.
Tristan.
[-- Attachment #2: setdeb.diff --]
[-- Type: text/plain, Size: 2941 bytes --]
# HG changeset patch
# User Tristan Gingold <tgingold@free.fr>
# Date 1182617932 -7200
# Node ID 675ccf45dc630166ad374023e119a68c48918088
# Parent 8a6a6d4afcb31c24ee87a5d30bebec41e8d38126
Add xc_domain_setdebugging in the xenctrl API.
Use it in xc_ptrace.c
Signed-off-by: Tristan Gingold <tgingold@free.fr>
diff -r 8a6a6d4afcb3 -r 675ccf45dc63 tools/libxc/xc_domain.c
--- a/tools/libxc/xc_domain.c Fri Jun 22 11:48:49 2007 -0600
+++ b/tools/libxc/xc_domain.c Sat Jun 23 18:58:52 2007 +0200
@@ -696,6 +696,18 @@ int xc_get_hvm_param(int handle, domid_t
return rc;
}
+int xc_domain_setdebugging(int xc_handle,
+ uint32_t domid,
+ unsigned int enable)
+{
+ DECLARE_DOMCTL;
+
+ domctl.cmd = XEN_DOMCTL_setdebugging;
+ domctl.domain = domid;
+ domctl.u.setdebugging.enable = enable;
+ return do_domctl(xc_handle, &domctl);
+}
+
/*
* Local variables:
* mode: C
diff -r 8a6a6d4afcb3 -r 675ccf45dc63 tools/libxc/xc_ptrace.c
--- a/tools/libxc/xc_ptrace.c Fri Jun 22 11:48:49 2007 -0600
+++ b/tools/libxc/xc_ptrace.c Sat Jun 23 18:58:52 2007 +0200
@@ -566,10 +566,7 @@ xc_ptrace(
}
if ( request == PTRACE_DETACH )
{
- domctl.cmd = XEN_DOMCTL_setdebugging;
- domctl.domain = current_domid;
- domctl.u.setdebugging.enable = 0;
- if ((retval = do_domctl(xc_handle, &domctl)))
+ if ((retval = xc_domain_setdebugging(xc_handle, current_domid, 0)))
goto out_error_domctl;
}
regs_valid = 0;
@@ -593,10 +590,7 @@ xc_ptrace(
else if ((retval = xc_domain_pause(xc_handle, current_domid)))
goto out_error_domctl;
current_is_hvm = !!(domctl.u.getdomaininfo.flags&XEN_DOMINF_hvm_guest);
- domctl.cmd = XEN_DOMCTL_setdebugging;
- domctl.domain = current_domid;
- domctl.u.setdebugging.enable = 1;
- if ((retval = do_domctl(xc_handle, &domctl)))
+ if ((retval = xc_domain_setdebugging(xc_handle, current_domid, 1)))
goto out_error_domctl;
if (get_online_cpumap(xc_handle, &domctl.u.getdomaininfo, &cpumap))
diff -r 8a6a6d4afcb3 -r 675ccf45dc63 tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h Fri Jun 22 11:48:49 2007 -0600
+++ b/tools/libxc/xenctrl.h Sat Jun 23 18:58:52 2007 +0200
@@ -433,6 +433,18 @@ int xc_domain_send_trigger(int xc_handle
uint32_t trigger,
uint32_t vcpu);
+/**
+ * This function enables or disable debugging of a domain.
+ *
+ * @parm xc_handle a handle to an open hypervisor interface
+ * @parm domid the domain id to send trigger
+ * @parm enable true to enable debugging
+ * return 0 on success, -1 on failure
+ */
+int xc_domain_setdebugging(int xc_handle,
+ uint32_t domid,
+ unsigned int enable);
+
/*
* EVENT CHANNEL FUNCTIONS
*/
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: PATCH: add xc_domain_setdebugging in xenctrl API
2007-06-23 17:04 PATCH: add xc_domain_setdebugging in xenctrl API Tristan Gingold
@ 2007-06-23 17:04 ` Keir Fraser
2007-07-02 18:13 ` Alex Williamson
1 sibling, 0 replies; 3+ messages in thread
From: Keir Fraser @ 2007-06-23 17:04 UTC (permalink / raw)
To: Tristan Gingold, xen-devel, Xen-ia64-devel, Alex Williamson
I don't understand your rationale, but I guess this is okay anyway.
-- Keir
On 23/6/07 18:04, "Tristan Gingold" <tgingold@free.fr> wrote:
> Hi,
>
> for ia64, I'd like to add xc_domain_setdebugging() in the xenctrl API.
> This patch implements it and modifies xc_ptrace.c to use it.
>
> The rationnal is enabling debugging tool not based on the ptrace API.
> The ptrace API is based on Linux ptrace which (at least on ia64) doesn't
> have many privilegied registers.
>
> I'd prefer this patch being integrated on xen-ia64-unstable tree but we
> need the OK from non-ia64 maintainers.
>
> Tristan.
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: PATCH: add xc_domain_setdebugging in xenctrl API
2007-06-23 17:04 PATCH: add xc_domain_setdebugging in xenctrl API Tristan Gingold
2007-06-23 17:04 ` Keir Fraser
@ 2007-07-02 18:13 ` Alex Williamson
1 sibling, 0 replies; 3+ messages in thread
From: Alex Williamson @ 2007-07-02 18:13 UTC (permalink / raw)
To: Tristan Gingold; +Cc: xen-devel, Xen-ia64-devel
On Sat, 2007-06-23 at 19:04 +0200, Tristan Gingold wrote:
> Hi,
>
> for ia64, I'd like to add xc_domain_setdebugging() in the xenctrl API.
> This patch implements it and modifies xc_ptrace.c to use it.
>
> The rationnal is enabling debugging tool not based on the ptrace API.
> The ptrace API is based on Linux ptrace which (at least on ia64) doesn't
> have many privilegied registers.
>
> I'd prefer this patch being integrated on xen-ia64-unstable tree but we
> need the OK from non-ia64 maintainers.
Applied. Thanks,
Alex
--
Alex Williamson HP Open Source & Linux Org.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-07-02 18:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-23 17:04 PATCH: add xc_domain_setdebugging in xenctrl API Tristan Gingold
2007-06-23 17:04 ` Keir Fraser
2007-07-02 18:13 ` Alex Williamson
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.