From: Ian Campbell Subject: Re: [PATCH v5 4/4] xen: introduce XENMEM_exchange_and_pin and XENMEM_unpin Date: Tue, 10 Sep 2013 13:50:50 +0100 Message-ID: <1378817450.21748.111.camel@kazak.uk.xensource.com> References: <1378742763-24299-4-git-send-email-stefano.stabellini@eu.citrix.com> <522F298D02000078000F1DE0@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VJNPs-0002dH-Gr for xen-devel@lists.xenproject.org; Tue, 10 Sep 2013 12:51:36 +0000 In-Reply-To: <522F298D02000078000F1DE0@nat28.tlf.novell.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: Jan Beulich Cc: xen-devel , tim@xen.org, Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Tue, 2013-09-10 at 13:15 +0100, Jan Beulich wrote: > > @@ -459,6 +460,52 @@ DEFINE_XEN_GUEST_HANDLE(xen_mem_sharing_op_t); > > * The zero value is appropiate. > > */ > > > > +#define XENMEM_exchange_and_pin 26 > > +/* > > + * This hypercall is similar to XENMEM_exchange: it takes the same > > + * struct as an argument and it exchanges the pages passed in with a new > > + * set of pages. The new pages are going to be "pinned": it's guaranteed > > + * that their p2m mapping won't be changed until explicitly "unpinned". > > + * The content of the exchanged pages is lost. > > + * Only normal guest r/w memory can be pinned: no granted pages or > > + * ballooned pages. > > + * If return code is zero then @out.extent_list provides the DMA frame > > + * numbers of the newly-allocated memory. > > "DMA"? I don't think that term is universally true across all possible > architectures (but we're in an architecture independent header > here). "Machine" would probably be better (as it implies CPU > perspective, whereas DMA hints at device perspective). I think DMA here is correct. The purpose of exchange and pin is so that the page can be safely handed to a device for DMA. On an architecture where DMA address != Machine address then this should indeed return the DMA addresses. Ian.