From patchwork Tue Jun 14 12:07:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 69994 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp2011602qgf; Tue, 14 Jun 2016 05:08:57 -0700 (PDT) X-Received: by 10.31.193.193 with SMTP id r184mr8510042vkf.4.1465906129715; Tue, 14 Jun 2016 05:08:49 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id s76si9531806vkb.70.2016.06.14.05.08.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Jun 2016 05:08:49 -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 1bCn7t-0004uT-Ep; Tue, 14 Jun 2016 12:07:25 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bCn7s-0004tA-Fe for xen-devel@lists.xen.org; Tue, 14 Jun 2016 12:07:24 +0000 Received: from [85.158.139.211] by server-11.bemta-5.messagelabs.com id E0/EE-04210-B73FF575; Tue, 14 Jun 2016 12:07:23 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrCLMWRWlGSWpSXmKPExsVysyfVTbf6c3y 4wbQPvBZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa8aepfNZCw4LVZz5OZm9gfEOXxcjJ4eQwCZG iUPr2LsYuYDs04wS+1ZdZwNJsAloStz5/IkJxBYRkJa49vkyI4jNLBAmcfvNLjBbWCBZYuqEK +wgNouAqsSMe0fA6nkFXCTWNa8Hq5EQkJM4eWwyaxcjBwengKvE3SnCEHtdJGa2zGKcwMi9gJ FhFaN6cWpRWWqRrqleUlFmekZJbmJmjq6hgalebmpxcWJ6ak5iUrFecn7uJkagbxmAYAfjl37 nQ4ySHExKory3J8aHC/El5adUZiQWZ8QXleakFh9ilOHgUJLgXfIJKCdYlJqeWpGWmQMMMpi0 BAePkgjvQpA0b3FBYm5xZjpE6hSjopQ470aQhABIIqM0D64NFtiXGGWlhHkZgQ4R4ilILcrNL EGVf8UozsGoJMy7FGQKT2ZeCdz0V0CLmYAW20wHW1ySiJCSamD0b0xzLom6eorroNAD4cXzdL w+x/k/Pnn3+jyNT2+XbvkUH7C07s1Sk7X76kvf/IzlNJjrYDVzLk9bzNoZc96mtU519jnSwvt vrm2G4T2xPIfdwSW7+HTM583Le9b0Ipj12Q/F1zKbLgfOSfXaV1mt/Ll/A+Mzh5PW237tXOKi y7/1yWvL+O2xSizFGYmGWsxFxYkAEe+T52cCAAA= X-Env-Sender: julien.grall@arm.com X-Msg-Ref: server-9.tower-206.messagelabs.com!1465906039!44866395!3 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 43350 invoked from network); 14 Jun 2016 12:07:23 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-9.tower-206.messagelabs.com with SMTP; 14 Jun 2016 12:07:23 -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 EA40A406; Tue, 14 Jun 2016 05:08:02 -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 030133F246; Tue, 14 Jun 2016 05:07:21 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Tue, 14 Jun 2016 13:07:03 +0100 Message-Id: <1465906027-16614-5-git-send-email-julien.grall@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1465906027-16614-1-git-send-email-julien.grall@arm.com> References: <1465906027-16614-1-git-send-email-julien.grall@arm.com> Cc: Julien Grall , sstabellini@kernel.org, wei.chen@linaro.org Subject: [Xen-devel] [PATCH 4/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 --- 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..46cfe24 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))