From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Vrabel Subject: Re: [PATCH] introduce grant copy for user land Date: Mon, 3 Nov 2014 18:03:11 +0000 Message-ID: <5457C35F.50504@citrix.com> References: <1412262916-22596-1-git-send-email-thanos.makatos@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XlLyf-0004DM-Iq for xen-devel@lists.xenproject.org; Mon, 03 Nov 2014 18:03:41 +0000 In-Reply-To: <1412262916-22596-1-git-send-email-thanos.makatos@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Thanos Makatos , xen-devel@lists.xenproject.org Cc: boris.ostrovsky@oracle.com, david.vrabel@citrix.com List-Id: xen-devel@lists.xenproject.org On 02/10/14 16:15, Thanos Makatos wrote: > This patch introduces the interface to allow user-space applications > execute grant-copy operations. This is done by sending an ioctl to the > grant device. The number of grant-copy segments is currently limited to > 16 in order to simplify the implementation, however the ABI allows an > arbitrary number of operations. Sorry for not responding earlier. If I haven't responded to a patch in a week, a reminder ping is appreciated. The arbitrary limitations in number of ops and page alignment should be removed. I think both can be removed relatively easily by consuming page aligned chunks of segments and doign the hypercall when a batch of ops is filled. > +struct gntdev_grant_copy_segment { > + /* > + * source address and length > + */ > + struct iovec iov; > + > + /* the granted page */ > + uint32_t ref; > + > + /* offset in the granted page */ > + uint16_t offset; > + > + /* grant copy result (GNTST_XXX) */ > + int16_t status; > +}; > + > +#define IOCTL_GNTDEV_GRANT_COPY \ > +_IOC(_IOC_NONE, 'G', 8, sizeof(struct ioctl_gntdev_grant_copy)) > +struct ioctl_gntdev_grant_copy { > + /* > + * copy direction: 0 to copy to guest, 1 to copy from guest > + */ > + int dir; I think this dir should be per-segment and use the GNTCPY_source_gref and GNTCOPY_dest_gref flags, since per-op direction is what the hypercall provides. > + > + /* domain ID */ > + uint32_t domid; > + > + unsigned int count; > + > + struct gntdev_grant_copy_segment __user *segments; > +}; David