From: "Jan Beulich" Subject: Re: [PATCH v3 3/3] xen: introduce XENMEM_get_dma_buf and XENMEM_put_dma_buf Date: Thu, 08 Aug 2013 15:50:39 +0100 Message-ID: <5203CC5F02000078000EA5EB@nat28.tlf.novell.com> References: <1375720856-8593-3-git-send-email-stefano.stabellini@eu.citrix.com> <5203A08F02000078000EA415@nat28.tlf.novell.com> <5203C97202000078000EA5C7@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1V7RY1-0005Ew-AG for xen-devel@lists.xenproject.org; Thu, 08 Aug 2013 14:50:41 +0000 In-Reply-To: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini Cc: xen-devel , tim@xen.org, Ian.Campbell@citrix.com List-Id: xen-devel@lists.xenproject.org >>> On 08.08.13 at 16:44, Stefano Stabellini wrote: > On Thu, 8 Aug 2013, Jan Beulich wrote: >> >>> On 08.08.13 at 16:12, Stefano Stabellini wrote: >> > On Thu, 8 Aug 2013, Jan Beulich wrote: >> >> >>> On 05.08.13 at 18:40, Stefano Stabellini wrote: >> >> > @@ -630,8 +690,15 @@ long do_memory_op(unsigned long cmd, >> > XEN_GUEST_HANDLE_PARAM(void) arg) >> >> > >> >> > break; >> >> > >> >> > + case XENMEM_get_dma_buf: >> >> > + /* xen_get_dma_buf_t is identical to xen_memory_exchange_t, so >> >> > + * just cast it and reuse memory_exchange */ >> >> >> >> Then why do you define a new type for it in the first place? >> > >> > Because the original hypercall doesn't copy back the mfn if the guest >> > it's an autotranslate guest. >> > And because it doesn't pin the p2m mappings. >> >> Hmm, I'm confused: Here you reason why you want a new type >> (note that I said "type", not "sub-hypercall"), ... >> >> >> And anyway, the naming of the new sub-op isn't really >> >> representing what the operation is capable of. >> >> XENMEM_exchange_and_pin would seem to come much closer. >> > >> > I like this suggestion. I could also keep xen_memory_exchange as >> > argument for XENMEM_exchange_and_pin, as Ian suggested. >> >> ... yet here you agree that xen_memory_exchange could be >> re-used. > > I meant only to keep the same parameter struct xen_memory_exchange. And that's what I asked for. Jan