From: "Jan Beulich" Subject: Re: [RFC PATCH 1/2] xen: introduce arch_iommu_grant_(un)map_page Date: Wed, 23 Jul 2014 12:27:40 +0100 Message-ID: <53CFB84C02000078000250DA@mail.emea.novell.com> References: <1404834794-16055-1-git-send-email-stefano.stabellini@eu.citrix.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 1X9uhz-00046p-M7 for xen-devel@lists.xenproject.org; Wed, 23 Jul 2014 11:27:43 +0000 In-Reply-To: <1404834794-16055-1-git-send-email-stefano.stabellini@eu.citrix.com> 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: julien.grall@citrix.com, xen-devel , Ian.Campbell@citrix.com List-Id: xen-devel@lists.xenproject.org >>> On 08.07.14 at 17:53, wrote: > --- a/xen/common/grant_table.c > +++ b/xen/common/grant_table.c > @@ -738,13 +738,13 @@ __gnttab_map_grant_ref( > !(old_pin & (GNTPIN_hstw_mask|GNTPIN_devw_mask)) ) > { > if ( wrc == 0 ) > - err = iommu_map_page(ld, frame, frame, > - IOMMUF_readable|IOMMUF_writable); > + err = arch_iommu_grant_map_page(ld, frame, > + IOMMUF_readable|IOMMUF_writable); This (and further similar code) sitting in (from an x86 perspective) PV code path makes the naming together with the hiding of the 1:1-ness quite undesirable. I.e. without enough care one may be tempted to call this seemingly generic function from a non-PV context. > --- a/xen/drivers/passthrough/x86/iommu.c > +++ b/xen/drivers/passthrough/x86/iommu.c > @@ -135,6 +135,17 @@ void arch_iommu_domain_destroy(struct domain *d) > } > } > > +int arch_iommu_grant_map_page(struct domain *d, unsigned long frame, > + unsigned flags) > +{ > + return iommu_map_page(d, frame, frame, flags); > +} > + > +int arch_iommu_grant_unmap_page(struct domain *d, unsigned long frame) > +{ > + return iommu_unmap_page(d, frame); > +} Is there no way to make these simple wrappers inline functions? Jan