xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3/3] libxc: add instruction length for inject trap in userspace
@ 2012-05-24 19:07 Xudong Hao
  0 siblings, 0 replies; only message in thread
From: Xudong Hao @ 2012-05-24 19:07 UTC (permalink / raw)
  To: Ian.Jackson
  Cc: eddie.dong, aravindh, Xudong Hao, xen-devel, keir.xen, JBeulich,
	Xiantao Zhang

Add a parameter to represent instruction length in function
xc_hvm_inject_trap(), user should set this value when this
function is called.

Signed-off-by: Xudong Hao <xudong.hao@intel.com>
Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
---
 tools/libxc/xc_misc.c               |    5 +++--
 tools/libxc/xenctrl.h               |    4 ++--
 tools/tests/xen-access/xen-access.c |    2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/tools/libxc/xc_misc.c b/tools/libxc/xc_misc.c
index a029d79..2989a62 100644
--- a/tools/libxc/xc_misc.c
+++ b/tools/libxc/xc_misc.c
@@ -602,8 +602,8 @@ int xc_hvm_get_mem_access(
 }
 
 int xc_hvm_inject_trap(
-    xc_interface *xch, domid_t dom, int vcpu, uint32_t trap, uint32_t error_code, 
-    uint64_t cr2)
+    xc_interface *xch, domid_t dom, int vcpu, uint32_t trap, uint32_t inslen, 
+    uint32_t error_code, uint64_t cr2)
 {
     DECLARE_HYPERCALL;
     DECLARE_HYPERCALL_BUFFER(struct xen_hvm_inject_trap, arg);
@@ -619,6 +619,7 @@ int xc_hvm_inject_trap(
     arg->domid       = dom;
     arg->vcpuid      = vcpu;
     arg->trap        = trap;
+    arg->inslen      = inslen;
     arg->error_code  = error_code;
     arg->cr2         = cr2;
 
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 3bbc827..7ed4c64 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -1578,8 +1578,8 @@ int xc_hvm_get_mem_access(
  * resumes. 
  */
 int xc_hvm_inject_trap(
-    xc_interface *xch, domid_t dom, int vcpu, uint32_t trap, uint32_t error_code, 
-    uint64_t cr2);
+    xc_interface *xch, domid_t dom, int vcpu, uint32_t trap, uint32_t inslen, 
+    uint32_t error_code, uint64_t cr2);
 
 /*
  *  LOGGING AND ERROR REPORTING
diff --git a/tools/tests/xen-access/xen-access.c b/tools/tests/xen-access/xen-access.c
index 906f46f..98332b0 100644
--- a/tools/tests/xen-access/xen-access.c
+++ b/tools/tests/xen-access/xen-access.c
@@ -662,7 +662,7 @@ int main(int argc, char *argv[])
                        req.vcpu_id);
 
                 /* Reinject */
-                rc = xc_hvm_inject_trap(xch, domain_id, req.vcpu_id, 3, -1, 0);
+                rc = xc_hvm_inject_trap(xch, domain_id, req.vcpu_id, 3, 1, -1, 0);
                 if (rc < 0)
                 {
                     ERROR("Error %d injecting int3\n", rc);
-- 
1.5.5

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-05-24 19:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-24 19:07 [PATCH 3/3] libxc: add instruction length for inject trap in userspace Xudong Hao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).