From patchwork Mon Jun 20 13:37:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 70447 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp1516301qgy; Mon, 20 Jun 2016 06:39:40 -0700 (PDT) X-Received: by 10.107.169.138 with SMTP id f10mr22279587ioj.192.1466429978155; Mon, 20 Jun 2016 06:39:38 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id o205si5166314itd.60.2016.06.20.06.39.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Jun 2016 06:39:38 -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 1bEzOc-0005H1-GP; Mon, 20 Jun 2016 13:37:46 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bEzOa-0005GS-Vm for xen-devel@lists.xen.org; Mon, 20 Jun 2016 13:37:45 +0000 Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id BB/BF-18769-8A1F7675; Mon, 20 Jun 2016 13:37:44 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrGLMWRWlGSWpSXmKPExsVysyfVTXf5x/R wg3VntC2WfFzM4sDocXT3b6YAxijWzLyk/IoE1oyerleMBU3CFVdPtDM2MLbwdzFycQgJbGKU mLL8LiOEc5pRYnvfWvYuRk4ONgFNiTufPzGB2CIC0hLXPl9mBLGZBRwk3ny8xwJiCwukSbS9m QZmswioSty5+AyshlfARWL9tIVgcQkBOYmTxyazgticAq4SB5/9AJsvBFTT/2sX0wRG7gWMDK sY1YtTi8pSi3Qt9JKKMtMzSnITM3N0DQ2M9XJTi4sT01NzEpOK9ZLzczcxAv3LAAQ7GC+0Ox9 ilORgUhLlnf4kPVyILyk/pTIjsTgjvqg0J7X4EKMMB4eSBO+zt0A5waLU9NSKtMwcYKDBpCU4 eJREeM3eAaV5iwsSc4sz0yFSpxgVpcR5pUASAiCJjNI8uDZYcF9ilJUS5mUEOkSIpyC1KDezB FX+FaM4B6OSMK8lyBSezLwSuOmvgBYzAS1e1g+2uCQRISXVwJj3RvzO7g+fvKrVj+vzxh66UH TXfHF55rwQUb75cjNtVk+Zx68YaPhFbaudqGBGtPiXBrUO8QMcrvsrUhgtXoYX7U0uYLV+3VQ j0xquvGq75fvyXI+99VPmHKhqORTkKhA8//yKswsmvzJWt5kXxPn3F4dKUbTQrWP341zjLk2b +Xx2/2r/JCWW4oxEQy3mouJEADfQGUppAgAA X-Env-Sender: julien.grall@arm.com X-Msg-Ref: server-7.tower-31.messagelabs.com!1466429863!38763529!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 25525 invoked from network); 20 Jun 2016 13:37:43 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-7.tower-31.messagelabs.com with SMTP; 20 Jun 2016 13:37:43 -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 15640BAD; Mon, 20 Jun 2016 06:38:28 -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 226233F246; Mon, 20 Jun 2016 06:37:41 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Mon, 20 Jun 2016 14:37:22 +0100 Message-Id: <1466429845-28240-6-git-send-email-julien.grall@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1466429845-28240-1-git-send-email-julien.grall@arm.com> References: <1466429845-28240-1-git-send-email-julien.grall@arm.com> Cc: Julien Grall , sstabellini@kernel.org Subject: [Xen-devel] [PATCH v2 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 1365b4a..008747c 100644 --- a/xen/arch/arm/domain.c +++ b/xen/arch/arm/domain.c @@ -444,13 +444,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))