From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: [PATCH v3 3/3] xen: introduce XENMEM_get_dma_buf and XENMEM_put_dma_buf Date: Thu, 08 Aug 2013 15:12:26 +0100 Message-ID: References: <1375958413.970.48.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1375958413.970.48.camel@kazak.uk.xensource.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: Ian Campbell , Stefano Stabellini Cc: xen-devel@lists.xensource.com, tim@xen.org List-Id: xen-devel@lists.xenproject.org On 08/08/2013 11:40, "Ian Campbell" wrote: >> it exchanges the pages >> + * passed in with a new set of pages, contiguous and under 4G if so >> + * requested. > > I guess it avoids exchanging the pages if they already meet this > constraint? > > The "if so requested" binds to "under 4G" and not "contiguous"? The > result is always contiguous I think. Also 4G is just an example and the > caller can ask for any order it likes. > > The contents of the pages will be lost I think. Perhaps in debug builds > we should consider actually nuking the page's content in the case where > we don't actually exchange? This confused me too, this talk of contiguity and being below 4GB. Doesn't this new hypercall behave *exactly* like XENMEM_exchange, except for the additional pinning of the MFNs? If so, just say that in the patch header and code comments. The fact *you* currently use it to get memory below 4GB is an application detail. I wonder whether XENMEM_exchange is much use at all in the presence of paging, without the additional semantics of pinning? Perhaps XENMEM_exchange could be suitably adjusted to have the pinning semantics in this case? -- Keir