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: 9190535 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3BD736075E for ; Tue, 21 Jun 2016 13:22:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2C1D827F8D for ; Tue, 21 Jun 2016 13:22:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1DEEE28174; Tue, 21 Jun 2016 13:22:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AA51927F8D for ; Tue, 21 Jun 2016 13:22:58 +0000 (UTC) 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" X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: Stefano Stabellini --- 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))