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-devel

[Xen-devel] [PATCH 6 of 7] REDO2: mem_access & mem_access 2: added trap

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 6 of 7] REDO2: mem_access & mem_access 2: added trap injection to libxc
From: Joe Epstein <jepstein98@xxxxxxxxx>
Date: Wed, 5 Jan 2011 19:53:49 -0800
Delivery-date: Wed, 05 Jan 2011 20:06:15 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:from:date :message-id:subject:to:content-type; bh=ZnHPIJ5KISNiz8ong0mDkl9nsZ7J2feobJT8nS1LFss=; b=rgP9ZCT+pQFNeqr7ZxUmRJoO3yoISBHFH4DVBypuOGoRQZkV24xbSnJi8AzEr+ILq5 P+wY/8lxEtJYyaGfe+W+u4013suaQljiPRlhbxWw3fXaxBAF1cHLbGlkvWVEYLMoQ3KE SXaGps4yvL+pi+youvdWmLqAZuVqBTdOuD7Jw=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=HPuHV7UCTvHihtRco1zp69WAhGFh+uDjLHM2d/pcy1faZuI8J2gp+Qz8oP7qUADp5X QNZmtzHozcyQecBjaNuBpstdxSuMoRnP73wZofTE8n4Ou13N9Ckx0YChghOxHvIla1Ln JKwdDk9dug9exN7IEyFnG0xfj2EJbRAXbpMDE=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
* Carries forward the trap injection hypercall into libxc

Signed-off-by: Joe Epstein <jepstein98@xxxxxxxxx


diff -r cfe66eacb934 -r 9b0f278f919a tools/libxc/xc_misc.c
--- a/tools/libxc/xc_misc.c    Wed Jan 05 19:03:41 2011 -0800
+++ b/tools/libxc/xc_misc.c    Wed Jan 05 19:05:50 2011 -0800
@@ -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 cfe66eacb934 -r 9b0f278f919a tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h    Wed Jan 05 19:03:41 2011 -0800
+++ b/tools/libxc/xenctrl.h    Wed Jan 05 19:05:50 2011 -0800
@@ -1426,6 +1426,14 @@ 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
  */
 

Attachment: 6.patch
Description: Text Data

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>