All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Xen Mailing List <xen-devel@lists.xensource.com>
Subject: [PATCH 3/9] privcmd interface addition to support share operations from Dom0 userspace
Date: Tue, 06 Jun 2006 15:50:02 +1000	[thread overview]
Message-ID: <1149573002.5183.32.camel@localhost.localdomain> (raw)
In-Reply-To: <1149572143.5183.25.camel@localhost.localdomain>

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

  reply	other threads:[~2006-06-06  5:50 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-06  5:35 [PATCH 1/9] Xen Share: Simplified I/O Mechanism Rusty Russell
2006-06-06  5:50 ` Rusty Russell [this message]
2006-06-06  5:51 ` [PATCH 4/9] /dev/xenshare for accessing/mapping shared pages from userspace Rusty Russell
2006-06-06  5:52 ` [PATCH 5/9] Vdevice share in start_info Rusty Russell
2006-06-06  5:54 ` [PATCH 6/9] Linux support for vdevice bus Rusty Russell
2006-06-07 10:03   ` Jacob Gorm Hansen
2006-06-07 10:58     ` Rusty Russell
2006-06-07 11:09       ` Jacob Gorm Hansen
2006-06-06  5:55 ` [PATCH 7/9] vdevice tool for manipulating " Rusty Russell
2006-06-06  5:57 ` [PATCH 8/9] Xen Share Net Device Rusty Russell
2006-06-06  5:58 ` [PATCH 2/9] Linux kernel infrastructure for Xen Share access Rusty Russell
2006-06-14 17:26   ` Mike D. Day
2006-06-06  5:59 ` [PATCH 9/9] Simple Xenshare Block Device and userspace backend Rusty Russell
2006-06-06 14:31 ` [PATCH 1/9] Xen Share: Simplified I/O Mechanism Harry Butterworth
2006-06-07  2:24   ` Rusty Russell
2006-06-06 14:47 ` Harry Butterworth
2006-06-07  2:35   ` Rusty Russell
2006-06-07 13:31     ` Harry Butterworth
2006-06-14 17:46 ` Mike D. Day

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1149573002.5183.32.camel@localhost.localdomain \
    --to=rusty@rustcorp.com.au \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.