WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] mem_access: added trap injection to libxc

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] mem_access: added trap injection to libxc
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 17 Jan 2011 07:58:55 -0800
Delivery-date: Mon, 17 Jan 2011 08:05:50 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Joe Epstein <jepstein98@xxxxxxxxx>
# Date 1294401290 0
# Node ID 32ec2fab6ea4ebf9be31a43c88937a75eb6f9040
# Parent  d9dca2bfe6b2eb9a7ba0f3568244d4c075f97344
mem_access: added trap injection to libxc

* Carries forward the trap injection hypercall into libxc

Signed-off-by: Joe Epstein <jepstein98@xxxxxxxxx>
Acked-by: Keir Fraser <keir@xxxxxxx>
Acked-by: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
---
 tools/libxc/xc_misc.c |   32 ++++++++++++++++++++++++++++++++
 tools/libxc/xenctrl.h |    8 ++++++++
 2 files changed, 40 insertions(+)

diff -r d9dca2bfe6b2 -r 32ec2fab6ea4 tools/libxc/xc_misc.c
--- a/tools/libxc/xc_misc.c     Fri Jan 07 11:54:48 2011 +0000
+++ b/tools/libxc/xc_misc.c     Fri Jan 07 11:54:50 2011 +0000
@@ -572,6 +572,38 @@ int xc_hvm_get_mem_access(
     return rc;
 }
 
+int xc_hvm_inject_trap(
+    xc_interface *xch, domid_t dom, int vcpu, uint32_t trap, uint32_t 
error_code, 
+    uint64_t cr2)
+{
+    DECLARE_HYPERCALL;
+    DECLARE_HYPERCALL_BUFFER(struct xen_hvm_inject_trap, arg);
+    int rc;
+
+    arg = xc_hypercall_buffer_alloc(xch, arg, sizeof(*arg));
+    if ( arg == NULL )
+    {
+        PERROR("Could not allocate memory for xc_hvm_inject_trap hypercall");
+        return -1;
+    }
+
+    arg->domid       = dom;
+    arg->vcpuid      = vcpu;
+    arg->trap        = trap;
+    arg->error_code  = error_code;
+    arg->cr2         = cr2;
+
+    hypercall.op     = __HYPERVISOR_hvm_op;
+    hypercall.arg[0] = HVMOP_inject_trap;
+    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
+
+    rc = do_xen_hypercall(xch, &hypercall);
+
+    xc_hypercall_buffer_free(xch, arg);
+
+    return rc;
+}
+
 /*
  * Local variables:
  * mode: C
diff -r d9dca2bfe6b2 -r 32ec2fab6ea4 tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h     Fri Jan 07 11:54:48 2011 +0000
+++ b/tools/libxc/xenctrl.h     Fri Jan 07 11:54:50 2011 +0000
@@ -1424,6 +1424,14 @@ int xc_hvm_set_mem_access(
  */
 int xc_hvm_get_mem_access(
     xc_interface *xch, domid_t dom, uint64_t pfn, hvmmem_access_t* memaccess);
+
+/*
+ * Injects a hardware/software CPU trap, to take effect the next time the HVM 
+ * resumes. 
+ */
+int xc_hvm_inject_trap(
+    xc_interface *xch, domid_t dom, int vcpu, uint32_t trap, uint32_t 
error_code, 
+    uint64_t cr2);
 
 /*
  *  LOGGING AND ERROR REPORTING

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] mem_access: added trap injection to libxc, Xen patchbot-unstable <=