From: Stefano Stabellini Subject: Re: [PATCH v3 3/3] xen: introduce XENMEM_get_dma_buf and XENMEM_put_dma_buf Date: Thu, 8 Aug 2013 15:54:38 +0100 Message-ID: References: <1375720856-8593-3-git-send-email-stefano.stabellini@eu.citrix.com> <5203A08F02000078000EA415@nat28.tlf.novell.com> <5203C97202000078000EA5C7@nat28.tlf.novell.com> <5203CC5F02000078000EA5EB@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1V7RcC-0005ji-MR for xen-devel@lists.xenproject.org; Thu, 08 Aug 2013 14:55:00 +0000 In-Reply-To: <5203CC5F02000078000EA5EB@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, Ian.Campbell@citrix.com, Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Thu, 8 Aug 2013, Jan Beulich wrote: > >>> 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. OK, I'll try to be clearer: I think it's reasonable to have a new hypercall, called XENMEM_exchange_and_pin, using the same struct parameter of XENMEM_exchange, called struct xen_memory_exchange. Actually Ian suggested this. Do you agree? If not, given that the paramters are actually the same, do you think I should duplicate and rename the struct as I was doing in this patch?