From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH 6/6] xen/gntalloc, gntdev: Add unmap notify ioctl Date: Mon, 14 Feb 2011 10:37:50 -0500 Message-ID: <20110214153750.GA10946@dumpdata.com> References: <1296753544-13323-1-git-send-email-dgdegra@tycho.nsa.gov> <1296753544-13323-7-git-send-email-dgdegra@tycho.nsa.gov> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1296753544-13323-7-git-send-email-dgdegra@tycho.nsa.gov> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Daniel De Graaf Cc: jeremy@goop.org, xen-devel@lists.xensource.com, Ian.Campbell@citrix.com List-Id: xen-devel@lists.xenproject.org > diff --git a/include/xen/gntalloc.h b/include/xen/gntalloc.h > index bc3b85e..257cc8d 100644 > --- a/include/xen/gntalloc.h > +++ b/include/xen/gntalloc.h > @@ -47,4 +47,32 @@ struct ioctl_gntalloc_dealloc_gref { > /* Number of references to unmap */ > uint32_t count; > }; > + > +/* > + * Sets up an unmap notification within the page, so that the other side can do > + * cleanup if this side crashes. Required to implement cross-domain robust > + * mutexes or close notification on communication channels. > + * > + * Each mapped page only supports one notification; multiple calls referring to > + * the same page overwrite the previous notification. You must clear the > + * notification prior to the IOCTL_GNTALLOC_DEALLOC_GREF if you do not want it > + * to occur. > + */ > +#define IOCTL_GNTALLOC_SET_UNMAP_NOTIFY \ > +_IOC(_IOC_NONE, 'G', 7, sizeof(struct ioctl_gntalloc_unmap_notify)) > +struct ioctl_gntalloc_unmap_notify { > + /* IN parameters */ > + /* Index of a byte in the page */ > + uint64_t index; That isn't actually the whole truth. It is the index within the page and also the "offset used on a subsequent call to mmap()" (ioctl_gntdev_map_grant_ref) It might make sense to change the description to: "offset of the mmap region and the index within the page" perhaps? > + /* Action(s) to take on unmap */ > + uint32_t action; > + /* Event channel to notify */ > + uint32_t event_channel_port; > +}; > + > +/* Clear (set to zero) the byte specified by index */ > +#define UNMAP_NOTIFY_CLEAR_BYTE 0x1 > +/* Send an interrupt on the indicated event channel */ > +#define UNMAP_NOTIFY_SEND_EVENT 0x2 > + > #endif /* __LINUX_PUBLIC_GNTALLOC_H__ */ > diff --git a/include/xen/gntdev.h b/include/xen/gntdev.h > index eb23f41..5d9b9b4 100644 > --- a/include/xen/gntdev.h > +++ b/include/xen/gntdev.h > @@ -116,4 +116,31 @@ struct ioctl_gntdev_set_max_grants { > uint32_t count; > }; > > +/* > + * Sets up an unmap notification within the page, so that the other side can do > + * cleanup if this side crashes. Required to implement cross-domain robust > + * mutexes or close notification on communication channels. > + * > + * Each mapped page only supports one notification; multiple calls referring to > + * the same page overwrite the previous notification. You must clear the > + * notification prior to the IOCTL_GNTALLOC_DEALLOC_GREF if you do not want it > + * to occur. > + */ > +#define IOCTL_GNTDEV_SET_UNMAP_NOTIFY \ > +_IOC(_IOC_NONE, 'G', 7, sizeof(struct ioctl_gntdev_unmap_notify)) > +struct ioctl_gntdev_unmap_notify { > + /* IN parameters */ > + /* Index of a byte in the page */ > + uint64_t index; Ditto. > + /* Action(s) to take on unmap */ > + uint32_t action; > + /* Event channel to notify */ > + uint32_t event_channel_port; > +}; > + > +/* Clear (set to zero) the byte specified by index */ > +#define UNMAP_NOTIFY_CLEAR_BYTE 0x1 > +/* Send an interrupt on the indicated event channel */ > +#define UNMAP_NOTIFY_SEND_EVENT 0x2 > + > #endif /* __LINUX_PUBLIC_GNTDEV_H__ */ > -- > 1.7.3.4 > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel