From patchwork Tue Jun 28 16:17:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 71107 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp1681579qgy; Tue, 28 Jun 2016 09:19:40 -0700 (PDT) X-Received: by 10.36.104.17 with SMTP id v17mr15236672itb.52.1467130779646; Tue, 28 Jun 2016 09:19:39 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id e72si15136909ite.40.2016.06.28.09.19.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Jun 2016 09:19:39 -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 1bHvhn-0006z4-3S; Tue, 28 Jun 2016 16:17:43 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bHvhl-0006xG-K6 for xen-devel@lists.xen.org; Tue, 28 Jun 2016 16:17:41 +0000 Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id 28/75-03403-423A2775; Tue, 28 Jun 2016 16:17:40 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrOLMWRWlGSWpSXmKPExsVysyfVTVdlcVG 4wbSLwhZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa8aBA1sYC94KV2z9/IG9gfE6fxcjF4eQwCZG iRMd11ghnNOMEjtmLWXrYuTkYBPQlLjz+RMTiC0iIC1x7fNlRhCbWcBB4s3HeywgtrBAhsTp1 zuYQWwWAVWJeVf6wOp5BVwkTi75AlYvISAncfLYZFYQm1PAVWLLlJ9g84WAai6cuMEygZF7AS PDKkaN4tSistQiXUNTvaSizPSMktzEzBxdQwNjvdzU4uLE9NScxKRiveT83E2MQA8zAMEOxjX bPQ8xSnIwKYnyfustChfiS8pPqcxILM6ILyrNSS0+xCjDwaEkwbtyIVBOsCg1PbUiLTMHGGow aQkOHiURXu5FQGne4oLE3OLMdIjUKUZFKXHe3SB9AiCJjNI8uDZYeF9ilJUS5mUEOkSIpyC1K DezBFX+FaM4B6OSMO81kCk8mXklcNNfAS1mAlrMWp0PsrgkESEl1cCYwchgsT3CTit63ykTGT UN/ky+zQ/2enFyViZ8b0novnDmZZPEq/VfYut4jQ9mm72PVjms+OB2xGH/vimWHpO3LL657NW 5eeYCu729DwYczUmxeVrFta54Io9g0pPee5vfTXzFo6JcvtiSX6b2tT5vZH5q0t0nzZqyD95Y ODrMuzHh2u7V6x8osRRnJBpqMRcVJwIA1UfVXmoCAAA= X-Env-Sender: julien.grall@arm.com X-Msg-Ref: server-12.tower-31.messagelabs.com!1467130659!31096090!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 21845 invoked from network); 28 Jun 2016 16:17:40 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-12.tower-31.messagelabs.com with SMTP; 28 Jun 2016 16:17:40 -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 C722A46E; Tue, 28 Jun 2016 09:18:31 -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 E4C173F21A; Tue, 28 Jun 2016 09:17:38 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Tue, 28 Jun 2016 17:17:09 +0100 Message-Id: <1467130643-23868-4-git-send-email-julien.grall@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1467130643-23868-1-git-send-email-julien.grall@arm.com> References: <1467130643-23868-1-git-send-email-julien.grall@arm.com> Cc: Julien Grall , sstabellini@kernel.org Subject: [Xen-devel] [PATCH v5 03/17] 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 Acked-by: Stefano Stabellini --- Changes in v4: - Add Stefano's acked-by 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))