From patchwork Mon Aug 14 14:23:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 110024 Delivered-To: patch@linaro.org Received: by 10.182.109.195 with SMTP id hu3csp4282133obb; Mon, 14 Aug 2017 07:26:48 -0700 (PDT) X-Received: by 10.36.184.196 with SMTP id m187mr6527880ite.18.1502720808220; Mon, 14 Aug 2017 07:26:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502720808; cv=none; d=google.com; s=arc-20160816; b=eY19vDmVekLkfOESRtQprQ8gIXiyZwvSDz8QgUkFRAiSKq+x/daEpE/dJfmnmj1WRd y/YHcykYCQ811vAc8mW3mWCNnmdW5aoCYaBQtBX0eoU3wPTSnRXqp9kEQUmUO8gksFLA xYNSLdqYMIF2RQ49daMhuOypJ77UFYhAKai3YQIOpzh1O1pNGNrsu03Cqc48fk8yoMXq /e6YudDhbNgKcL2VaUsre/NvgDRsObP7uW3jcUUj3vUhTc9EdndDo1YIOdMsxJf0qh7d eYh37+AmtGpbg36nMcIqfBM5JTABEfRtMw/Xrqo6tXyO4+BREE7mu+fLALaTUKz9cLWc Ys7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:cc:references:in-reply-to:message-id:date:to :from:arc-authentication-results; bh=PoxHdrXraAFqY7iC6LQR+No7FgK8pgMlpE7aIfJy/DI=; b=o4vNfaO/bdNtiQGUVe8grUBsqhobhlR3jFm6Lygz84TMf090l0IKMf5DvKBdG/9wTs ZNtWay3W89VXMR5LaIgDzbZc4+PWJZn41Vm0vwaLCAf7PoZpRdhrCnClrYyW+B4LHzWv qGhOr0kCq135yTt5AE0xysOc1DLL0F3e6VVJo2g62AZu67bBnTR69WoIYgdN+AHFcZAW tfqXd6wS4GtKK1J6Zfe/+c7dZTeUc29Mqua3M4le/BX2yVAVzwMXAiCj/xpF1XpBexi6 XTW79s0tbyrHL1im7yiIwAxZsLpjguoUWPLDfKyZ1fdD549XB5gMDvXdi9D9ZuklzW+3 hu0g== ARC-Authentication-Results: i=1; mx.google.com; spf=neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id f202si5603071itb.121.2017.08.14.07.26.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Aug 2017 07:26:48 -0700 (PDT) Received-SPF: neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dhGIN-0000JN-Mp; Mon, 14 Aug 2017 14:24:43 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dhGIN-0000IF-72 for xen-devel@lists.xen.org; Mon, 14 Aug 2017 14:24:43 +0000 Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id 88/9F-01994-AA2B1995; Mon, 14 Aug 2017 14:24:42 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrMLMWRWlGSWpSXmKPExsVysyfVTXflpom RBnP+GVks+biYxYHR4+ju30wBjFGsmXlJ+RUJrBnzJrWyFEwUrri9oZe1gXGjQBcjJ4eQwGZG ibYz5V2MXED2aUaJoysvsIIk2AQ0Je58/sQEYosISEtc+3yZEaSIWeA1k8TnrduYQRLCAlES0 y/+BrNZBFQlDva+AWvgFbCUWLPiIjuILSEgL7Gr7SLYUE4BK4nOuztZIDZbSpxYPZttAiP3Ak aGVYwaxalFZalFukYWeklFmekZJbmJmTm6hgamermpxcWJ6ak5iUnFesn5uZsYgR6uZ2Bg3MH Yt8rvEKMkB5OSKG+CT2+kEF9SfkplRmJxRnxRaU5q8SFGGQ4OJQne1I0TI4UEi1LTUyvSMnOA oQaTluDgURLhnQWS5i0uSMwtzkyHSJ1i1OV4NeH/NyYhlrz8vFQpcd5ykCIBkKKM0jy4EbCwv 8QoKyXMy8jAwCDEU5BalJtZgir/ilGcg1FJmHczyBSezLwSuE2vgI5gAjqiD+R+3uKSRISUVA Pj9NV6TjsSWye9vXerKO6QZ+fNPd1H5gasVWjax7D12xZb0aZpp4PN16psMtM9pc6dM0nQvux pJZ/WwXkuPk+Lj+ud4g8x+fzm11G5O9tev332UlRg85qYXfWvtvjut2Hg/LJ+5cGGLR2NjC6b 97a9Oalqf8/ScE3NDu55nE57n+V8b9XaFyejrsRSnJFoqMVcVJwIAIMeOOJ2AgAA X-Env-Sender: julien.grall@arm.com X-Msg-Ref: server-2.tower-206.messagelabs.com!1502720681!86596146!1 X-Originating-IP: [217.140.101.70] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 21556 invoked from network); 14 Aug 2017 14:24:41 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-2.tower-206.messagelabs.com with SMTP; 14 Aug 2017 14:24:41 -0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0BB181688; Mon, 14 Aug 2017 07:24:41 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.206.53]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1B3BC3F483; Mon, 14 Aug 2017 07:24:38 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Mon, 14 Aug 2017 15:23:57 +0100 Message-Id: <20170814142418.13267-7-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170814142418.13267-1-julien.grall@arm.com> References: <20170814142418.13267-1-julien.grall@arm.com> Cc: sstabellini@kernel.org, Wei Liu , George Dunlap , andre.przywara@arm.com, Ian Jackson , Tim Deegan , Julien Grall , Jan Beulich , Andrew Cooper Subject: [Xen-devel] [PATCH 06/27] xen/mm: Use __virt_to_mfn in map_domain_page instead of virt_to_mfn X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" virt_to_mfn may by overridden by the source files, for improving locally typesafe. Therefore map_domain_page has to use __virt_to_mfn to prevent any compilation issue in sources files that override the helper. Signed-off-by: Julien Grall Acked-by: Jan Beulich --- Cc: Stefano Stabellini Cc: Andrew Cooper Cc: George Dunlap Cc: Ian Jackson Cc: Jan Beulich Cc: Konrad Rzeszutek Wilk Cc: Tim Deegan Cc: Wei Liu --- xen/include/asm-arm/mm.h | 3 ++- xen/include/xen/domain_page.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/xen/include/asm-arm/mm.h b/xen/include/asm-arm/mm.h index 28bdcc900e..71d7d36992 100644 --- a/xen/include/asm-arm/mm.h +++ b/xen/include/asm-arm/mm.h @@ -253,7 +253,7 @@ static inline int gvirt_to_maddr(vaddr_t va, paddr_t *pa, unsigned int flags) /* Convert between Xen-heap virtual addresses and machine frame numbers. */ #define __virt_to_mfn(va) (virt_to_maddr(va) >> PAGE_SHIFT) -#define mfn_to_virt(mfn) (maddr_to_virt((paddr_t)(mfn) << PAGE_SHIFT)) +#define __mfn_to_virt(mfn) (maddr_to_virt((paddr_t)(mfn) << PAGE_SHIFT)) /* * We define non-underscored wrappers for above conversion functions. @@ -263,6 +263,7 @@ static inline int gvirt_to_maddr(vaddr_t va, paddr_t *pa, unsigned int flags) #define mfn_to_page(mfn) __mfn_to_page(mfn) #define page_to_mfn(pg) __page_to_mfn(pg) #define virt_to_mfn(va) __virt_to_mfn(va) +#define mfn_to_virt(mfn) __mfn_to_virt(mfn) /* Convert between Xen-heap virtual addresses and page-info structures. */ static inline struct page_info *virt_to_page(const void *v) diff --git a/xen/include/xen/domain_page.h b/xen/include/xen/domain_page.h index 93f2a5aaf7..890bae5b9c 100644 --- a/xen/include/xen/domain_page.h +++ b/xen/include/xen/domain_page.h @@ -53,7 +53,7 @@ static inline void *__map_domain_page_global(const struct page_info *pg) #else /* !CONFIG_DOMAIN_PAGE */ -#define map_domain_page(mfn) mfn_to_virt(mfn_x(mfn)) +#define map_domain_page(mfn) __mfn_to_virt(mfn_x(mfn)) #define __map_domain_page(pg) page_to_virt(pg) #define unmap_domain_page(va) ((void)(va)) #define domain_page_map_to_mfn(va) virt_to_mfn((unsigned long)(va))