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 3/9] privcmd interface addition to support share oper

To: Xen Mailing List <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH 3/9] privcmd interface addition to support share operations from Dom0 userspace
From: Rusty Russell <rusty@xxxxxxxxxxxxxxx>
Date: Tue, 06 Jun 2006 15:50:02 +1000
Delivery-date: Mon, 05 Jun 2006 22:50:31 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <1149572143.5183.25.camel@xxxxxxxxxxxxxxxxxxxxx>
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1149572143.5183.25.camel@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Subject: privcmd interface addition to support share operations from Dom0 
userspace

We create to simple privcmd ops to create and grant access to shares.

diff -r 6d476981e3a5 -r 07a00d96357d 
linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c
--- a/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c        Sun May 28 
14:49:17 2006
+++ b/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c        Wed May 31 
05:33:38 2006
@@ -268,6 +268,7 @@
        set_bit(__HYPERVISOR_xen_version,      hypercall_permission_map);
        set_bit(__HYPERVISOR_sched_op,         hypercall_permission_map);
        set_bit(__HYPERVISOR_sched_op_compat,  hypercall_permission_map);
+       set_bit(__HYPERVISOR_share_op,         hypercall_permission_map);
        set_bit(__HYPERVISOR_event_channel_op_compat,
                hypercall_permission_map);
 
diff -r 6d476981e3a5 -r 07a00d96357d tools/libxc/xc_domain.c
--- a/tools/libxc/xc_domain.c   Sun May 28 14:49:17 2006
+++ b/tools/libxc/xc_domain.c   Wed May 31 05:33:38 2006
@@ -482,6 +482,25 @@
     return rc;
 
 }
+
+share_ref_t xc_create_shared_pages(int xc_handle, unsigned int num_pages)
+{
+    DECLARE_DOM0_OP;
+
+    op.cmd = DOM0_CREATESHAREDPAGES;
+    op.u.createsharedpages.num = num_pages;
+    return do_dom0_op(xc_handle, &op);
+}
+
+int xc_grant_shared_pages(int xc_handle, domid_t domid, share_ref_t share_ref)
+{
+    DECLARE_DOM0_OP;
+
+    op.cmd = DOM0_GRANTSHAREDPAGES;
+    op.u.grantsharedpages.domain = domid;
+    op.u.grantsharedpages.share_ref = share_ref;
+    return do_dom0_op(xc_handle, &op);
+}    
 
 int xc_domain_irq_permission(int xc_handle,
                              uint32_t domid,
diff -r 6d476981e3a5 -r 07a00d96357d tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h     Sun May 28 14:49:17 2006
+++ b/tools/libxc/xenctrl.h     Wed May 31 05:33:38 2006
@@ -21,6 +21,7 @@
 #include <xen/memory.h>
 #include <xen/acm.h>
 #include <xen/acm_ops.h>
+#include <xen/share.h>
 
 #ifdef __ia64__
 #define XC_PAGE_SHIFT           14
@@ -584,6 +585,10 @@
 
 int xc_version(int xc_handle, int cmd, void *arg);
 
+/* Create & add permissions to sharable pages. */
+share_ref_t xc_create_shared_pages(int xc_handle, unsigned int num_pages);
+int xc_grant_shared_pages(int xc_handle, domid_t domid, share_ref_t share_ref);
+
 /*
  * MMU updates.
  */

-- 
 ccontrol: http://ccontrol.ozlabs.org


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