From: "Jan Beulich" Subject: Re: [PATCH v2 1/3] xen/domain_page: Convert map_domain_page_global() to using mfn_t Date: Tue, 07 Jul 2015 11:01:04 +0100 Message-ID: <559BBF80020000780008D42A@mail.emea.novell.com> References: <1435838656-9219-1-git-send-email-Ben.Catterall@citrix.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 1ZCPgb-0000HH-Db for xen-devel@lists.xenproject.org; Tue, 07 Jul 2015 10:01:09 +0000 In-Reply-To: <1435838656-9219-1-git-send-email-Ben.Catterall@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: andrew.cooper3@citrix.com, Ben Catterall Cc: xen-devel@lists.xenproject.org, keir@xen.org, stefano.stabellini@citrix.com, ian.campbell@citrix.com, tim@xen.org List-Id: xen-devel@lists.xenproject.org >>> On 02.07.15 at 14:04, wrote: > --- a/xen/include/xen/domain_page.h > +++ b/xen/include/xen/domain_page.h > @@ -41,11 +41,15 @@ unsigned long domain_page_map_to_mfn(const void *va); > * address spaces (not just within the VCPU that created the mapping). Global > * mappings can also be unmapped from any context. > */ > -void *map_domain_page_global(unsigned long mfn); > +void *map_domain_page_global(mfn_t mfn); > void unmap_domain_page_global(const void *va); > > #define __map_domain_page(pg) map_domain_page(__page_to_mfn(pg)) > -#define __map_domain_page_global(pg) map_domain_page_global(__page_to_mfn(pg)) > + > +static inline void *__map_domain_page_global(struct page_info *pg) const > @@ -117,9 +121,17 @@ domain_mmap_cache_destroy(struct domain_mmap_cache *cache) > mfn_to_virt(smfn)) > #define domain_page_map_to_mfn(va) virt_to_mfn((unsigned long)(va)) > > -#define map_domain_page_global(mfn) mfn_to_virt(mfn) > -#define __map_domain_page_global(pg) page_to_virt(pg) > -#define unmap_domain_page_global(va) ((void)(va)) > +static inline void *map_domain_page_global(mfn_t mfn) > +{ > + return mfn_to_virt(mfn_x(mfn)); > +} > + > +static inline void *__map_domain_page_global(struct page_info *pg) const > +{ > + return page_to_virt(pg); > +} > + > +static inline void unmap_domain_page_global(void *va) {}; And again (the more that the real function already has it that way). With these adjusted Reviewed-by: Jan Beulich Jan