From patchwork Tue Jun 21 13:20:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 70560 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp2015980qgy; Tue, 21 Jun 2016 06:23:02 -0700 (PDT) X-Received: by 10.36.112.199 with SMTP id f190mr5591910itc.6.1466515382139; Tue, 21 Jun 2016 06:23:02 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id f16si40181719iof.132.2016.06.21.06.23.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Jun 2016 06:23:01 -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 1bFLbw-0004S9-Aq; Tue, 21 Jun 2016 13:21:00 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bFLbv-0004RH-KN for xen-devel@lists.xen.org; Tue, 21 Jun 2016 13:20:59 +0000 Received: from [85.158.139.211] by server-13.bemta-5.messagelabs.com id 53/A8-16475-A3F39675; Tue, 21 Jun 2016 13:20:58 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrGLMWRWlGSWpSXmKPExsVysyfVTdfKPjP c4HivosWSj4tZHBg9ju7+zRTAGMWamZeUX5HAmvH48EOWgibhigv9B1gaGFv4uxi5OIQENjFK 9D4/xNjFyAnknGaU+HKOGcRmE9CUuPP5ExOILSIgLXHt82WwGmYBB4k3H++xgNjCAmkSL9/NZ AexWQRUJU7fughWwyvgIvH7YjsriC0hICdx8thkMJtTwFVi48UuJohdLhKTj35hmcDIvYCRYR WjRnFqUVlqka6RoV5SUWZ6RkluYmaOrqGBqV5uanFxYnpqTmJSsV5yfu4mRqB/6xkYGHcw3p3 sd4hRkoNJSZSXWTkjXIgvKT+lMiOxOCO+qDQntfgQowwHh5IEr55tZriQYFFqempFWmYOMNBg 0hIcPEoivOkgad7igsTc4sx0iNQpRkUpcd7JNkAJAZBERmkeXBssuC8xykoJ8zIyMDAI8RSkF uVmlqDKv2IU52BUEuZ9DzKFJzOvBG76K6DFTECLl/WngywuSURISTUwaj7RrYkJC1+1ubh5Dk /ddQOe3hKL2yf+OKYsDw7+qP1q2Yu7DHutlLbul7m41q1h/6Z3E8X3/dx475auq4/XRjFHw2D d1tmzFFK2buep4p/NOfvRjLNiW1+pbewMFug7IG7GafD0JxPb4Sc58pY2zNwWk7fL3g36XpN1 4qHLwSMfDjzbEP1NWImlOCPRUIu5qDgRAJ0TYOFpAgAA X-Env-Sender: julien.grall@arm.com X-Msg-Ref: server-6.tower-206.messagelabs.com!1466515258!45703056!1 X-Originating-IP: [217.140.101.70] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.46; banners=-,-,- X-VirusChecked: Checked Received: (qmail 34719 invoked from network); 21 Jun 2016 13:20:58 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-6.tower-206.messagelabs.com with SMTP; 21 Jun 2016 13:20:58 -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 EE36C95D; Tue, 21 Jun 2016 06:21:43 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.215.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 32B863F246; Tue, 21 Jun 2016 06:20:57 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Tue, 21 Jun 2016 14:20:40 +0100 Message-Id: <1466515243-27264-6-git-send-email-julien.grall@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1466515243-27264-1-git-send-email-julien.grall@arm.com> References: <1466515243-27264-1-git-send-email-julien.grall@arm.com> Cc: Julien Grall , sstabellini@kernel.org Subject: [Xen-devel] [PATCH v3 5/8] xen/arm: Rename grant_table_gfpn into grant_table_gfn and use the typesafe gfn 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" The correct acronym for a guest physical frame is gfn. Also use the typesafe gfn to ensure that a guest frame is effectively used. Signed-off-by: Julien Grall --- Changes in v2: - Remove extra pair of brackets. --- xen/arch/arm/domain.c | 4 ++-- xen/arch/arm/mm.c | 2 +- xen/include/asm-arm/domain.h | 2 +- xen/include/asm-arm/grant_table.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c index d8a804c..6ce4645 100644 --- a/xen/arch/arm/domain.c +++ b/xen/arch/arm/domain.c @@ -464,13 +464,13 @@ struct domain *alloc_domain_struct(void) return NULL; clear_page(d); - d->arch.grant_table_gpfn = xzalloc_array(xen_pfn_t, max_grant_frames); + d->arch.grant_table_gfn = xzalloc_array(gfn_t, max_grant_frames); return d; } void free_domain_struct(struct domain *d) { - xfree(d->arch.grant_table_gpfn); + xfree(d->arch.grant_table_gfn); free_xenheap_page(d); } diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c index 6882d54..0e408f8 100644 --- a/xen/arch/arm/mm.c +++ b/xen/arch/arm/mm.c @@ -1082,7 +1082,7 @@ int xenmem_add_to_physmap_one( return -EINVAL; } - d->arch.grant_table_gpfn[idx] = gfn_x(gfn); + d->arch.grant_table_gfn[idx] = gfn; t = p2m_ram_rw; diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h index 370cdeb..979f7de 100644 --- a/xen/include/asm-arm/domain.h +++ b/xen/include/asm-arm/domain.h @@ -51,7 +51,7 @@ struct arch_domain uint64_t vttbr; struct hvm_domain hvm_domain; - xen_pfn_t *grant_table_gpfn; + gfn_t *grant_table_gfn; struct vmmio vmmio; diff --git a/xen/include/asm-arm/grant_table.h b/xen/include/asm-arm/grant_table.h index 5e076cc..eb02423 100644 --- a/xen/include/asm-arm/grant_table.h +++ b/xen/include/asm-arm/grant_table.h @@ -30,7 +30,7 @@ static inline int replace_grant_supported(void) #define gnttab_shared_gmfn(d, t, i) \ ( ((i >= nr_grant_frames(d->grant_table)) && \ - (i < max_grant_frames)) ? 0 : (d->arch.grant_table_gpfn[i])) + (i < max_grant_frames)) ? 0 : gfn_x(d->arch.grant_table_gfn[i])) #define gnttab_need_iommu_mapping(d) \ (is_domain_direct_mapped(d) && need_iommu(d))