From patchwork Tue Sep 12 10:03:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 112283 Delivered-To: patch@linaro.org Received: by 10.80.202.13 with SMTP id d13csp5674653edi; Tue, 12 Sep 2017 03:05:55 -0700 (PDT) X-Google-Smtp-Source: AOwi7QCkZI/BSKZf4sUpAyn+x8Wbl79KPCKkmcZ5qfCH4nf22GM2hI4iEEX6xofQu69KkDuGdvkw X-Received: by 10.36.20.86 with SMTP id 83mr284041itg.44.1505210755462; Tue, 12 Sep 2017 03:05:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505210755; cv=none; d=google.com; s=arc-20160816; b=lcMmZoFPSmwUw7Kd7ySSDnDpW7Q+lhVL6iCxwZtBfifFVW97O/Uu24mfwDoVbnmTjq NegssQpjYg1ABCrPjqHb0NMjBlEd5hoBOn5HD8g/oqBBHnD7X+lI5gfugyMPCaTrLfE4 jzq+oMgEDBySVulJAFUooeSIcf49arrmNkgOSnnWxeny76VD8p/EBnpbsp+9QEe1VaBR 2JqN1S/WZE1q2mTt1N5OBxSQcvN6RS237fTn3NFXyfw+uwpw/atux4dkTcPyyjdOV7+C BNiNuM+8z9M3vmMj+3EtRm+EsbZo8zyRWIC2kadx4LY58QlL0OKJdsc5IVutPXQE2i2t Kpjg== 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=B6jcBPgV6NlVehCTUSFK+/rKQvC+vSKS7jK0s8oMiqI=; b=o9mehT8zCikeUUMzd5rjSKonr833hwRfxrCmlsZ9cblxKBcYzJPcttW8uSIW6dM+Xl eOusBE0gDg2qmbaYt893X4tjjoV9xdDjXN09X7yWT10sn8Coq5ZAGPZukAFwZERWtmsx bJvAhqJdrrp7DsoxctD5Unf7NvGCyFmOjrEdzHEmUgpxzYloHVbYJceDtdzvuq9eUHsU Ae2k0jdXnyFrM17dMXjcoCTlr2GpzWCvqL2o/To7T3TysJU+XDfGwqth2FTqJIEVoGSr zkR2E60qZ4COHF6nGtv7klYvQiPN2d8B32EKG3wFG9k0fP/h3NeeVdBfCVMfKQsucsU4 tmng== 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 8si935236ita.114.2017.09.12.03.05.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Sep 2017 03:05:55 -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 1dri2l-0002qK-A4; Tue, 12 Sep 2017 10:03:47 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dri2j-0002pC-M5 for xen-devel@lists.xen.org; Tue, 12 Sep 2017 10:03:45 +0000 Received: from [193.109.254.147] by server-4.bemta-6.messagelabs.com id CE/36-03283-101B7B95; Tue, 12 Sep 2017 10:03:45 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrILMWRWlGSWpSXmKPExsVysyfVTZdh4/Z IgwuLpS2WfFzM4sDocXT3b6YAxijWzLyk/IoE1oyFa8ILnghXNJ9+z9LA+EWgi5GLQ0hgM6NE 2/QtjBDOaUaJt8+6WLoYOTnYBDQl7nz+xARiiwhIS1z7fBmsiFngNZPE563bmLsYOTiEBWIl7 l51A6lhEVCV6Nywhh3E5hWwkGie1MUKYksIyEvsarsIZnMKWEqs+PiLDcQWAqr5/vIH4wRG7g WMDKsY1YtTi8pSi3RN9JKKMtMzSnITM3N0DQ3M9HJTi4sT01NzEpOK9ZLzczcxAr3LAAQ7GLs v+x9ilORgUhLl/S28PVKILyk/pTIjsTgjvqg0J7X4EKMMB4eSBO+09UA5waLU9NSKtMwcYJjB pCU4eJREeONA0rzFBYm5xZnpEKlTjLocHTfv/mESYsnLz0uVEufNACkSACnKKM2DGwEL+UuMs lLCvIxARwnxFKQW5WaWoMq/YhTnYFQS5p0PMoUnM68EbtMroCOYgI7gubQF5IiSRISUVANjpu GWzd09PKt5F63ku1bg/FZu8Rx9AfXi3RWizgd5DJY1zd/EfS69qVxyj8jT1lnC399WpCxLrGV alzt557kdsbpPTXXVlTdxmFx0XRSZ1Fbt9STc8xr3l8+Wp7eo/XiXUaM7ncNZ+OHZ3nlsR+xD 2AreyPBwGf9iX3+/LfrEoksRtmpTo78osRRnJBpqMRcVJwIAw/vHMHQCAAA= X-Env-Sender: julien.grall@arm.com X-Msg-Ref: server-13.tower-27.messagelabs.com!1505210623!106791695!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 10430 invoked from network); 12 Sep 2017 10:03:44 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-13.tower-27.messagelabs.com with SMTP; 12 Sep 2017 10:03:44 -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 B9A7C15A2; Tue, 12 Sep 2017 03:03:43 -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 C6CCC3F578; Tue, 12 Sep 2017 03:03:41 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Tue, 12 Sep 2017 11:03:09 +0100 Message-Id: <20170912100330.2168-4-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170912100330.2168-1-julien.grall@arm.com> References: <20170912100330.2168-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 v2 03/24] 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 Reviewed-by: Wei Liu Acked-by: Stefano Stabellini --- Changes in v2: - Add Jan's acked-by 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 7de2f32f58..cd6dfb54b9 100644 --- a/xen/include/asm-arm/mm.h +++ b/xen/include/asm-arm/mm.h @@ -281,7 +281,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. @@ -291,6 +291,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))