From patchwork Thu Jul 28 14:51:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 72971 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp894586qga; Thu, 28 Jul 2016 07:54:15 -0700 (PDT) X-Received: by 10.107.183.85 with SMTP id h82mr39961365iof.63.1469717655889; Thu, 28 Jul 2016 07:54:15 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id g28si13457639ioi.148.2016.07.28.07.54.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jul 2016 07:54:15 -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 1bSmfR-00030k-CG; Thu, 28 Jul 2016 14:52:09 +0000 Received: from mail6.bemta6.messagelabs.com ([85.158.143.247]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bSmfP-0002xs-Rp for xen-devel@lists.xen.org; Thu, 28 Jul 2016 14:52:07 +0000 Received: from [85.158.143.35] by server-3.bemta-6.messagelabs.com id FF/84-05661-71C1A975; Thu, 28 Jul 2016 14:52:07 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrGLMWRWlGSWpSXmKPExsVysyfVTVdMZla 4wapV6hZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa8b+d6dZClbwVMyc8petgbGFq4uRi0NIYBOj xLFrt1ggnNOMEkcfPmDsYuTkYBPQlLjz+RMTiC0iIC1x7fNlRpAiZoF2Rom1/b3MIAlhgUCJ1 8/7WEBsFgFVien/5oDZvAIuEis27wFrlhCQkzh5bDJrFyMHBydQ/HW3EEhYSMBZYvrMpYwTGL kXMDKsYlQvTi0qSy3SNdFLKspMzyjJTczM0TU0MNPLTS0uTkxPzUlMKtZLzs/dxAj0LwMQ7GD svux/iFGSg0lJlDcsdGa4EF9SfkplRmJxRnxRaU5q8SFGGQ4OJQneW1KzwoUEi1LTUyvSMnOA gQaTluDgURLhlZMGSvMWFyTmFmemQ6ROMSpKifPygiQEQBIZpXlwbbDgvsQoKyXMywh0iBBPQ WpRbmYJqvwrRnEORiVhXgOQKTyZeSVw018BLWYCWlwcOwNkcUkiQkqqgdF/34bVrdefmL96dN tY+5yxsaVFy+6FB9JztMMuNUe9fnRx+px/O/U0m4XPLlB7urziR5qEo0qTiJ/+9t/hbHbL9xt H2FT5+iplu7f5ird8Yn/55+4n96vrV05YcPoBxx7JmIqVS+b07GQ9VlnkVrM9Y93N2z8s6jfE LJZ37pwa+Eljv8anSlklluKMREMt5qLiRADdFes1aQIAAA== X-Env-Sender: julien.grall@arm.com X-Msg-Ref: server-8.tower-21.messagelabs.com!1469717526!26026333!1 X-Originating-IP: [217.140.101.70] X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50 X-StarScan-Received: X-StarScan-Version: 8.77; banners=-,-,- X-VirusChecked: Checked Received: (qmail 58393 invoked from network); 28 Jul 2016 14:52:06 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-8.tower-21.messagelabs.com with SMTP; 28 Jul 2016 14:52:06 -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 1960BBBB; Thu, 28 Jul 2016 07:53:23 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.218.32]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D8B323F21A; Thu, 28 Jul 2016 07:52:04 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Thu, 28 Jul 2016 15:51:33 +0100 Message-Id: <1469717505-8026-11-git-send-email-julien.grall@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1469717505-8026-1-git-send-email-julien.grall@arm.com> References: <1469717505-8026-1-git-send-email-julien.grall@arm.com> Cc: proskurin@sec.in.tum.de, Julien Grall , sstabellini@kernel.org, steve.capper@arm.com, wei.chen@linaro.org Subject: [Xen-devel] [RFC 10/22] xen/arm: p2m: Move the lookup helpers at the top of the file 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" This will be used later in functions that will be defined earlier in the file. Signed-off-by: Julien Grall --- xen/arch/arm/p2m.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index 798faa8..ea582c8 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -29,6 +29,14 @@ static unsigned int __read_mostly p2m_root_level; unsigned int __read_mostly p2m_ipa_bits; +/* Helpers to lookup the properties of each level */ +static const paddr_t level_sizes[] = + { ZEROETH_SIZE, FIRST_SIZE, SECOND_SIZE, THIRD_SIZE }; +static const paddr_t level_masks[] = + { ZEROETH_MASK, FIRST_MASK, SECOND_MASK, THIRD_MASK }; +static const unsigned int level_shifts[] = + { ZEROETH_SHIFT, FIRST_SHIFT, SECOND_SHIFT, THIRD_SHIFT }; + static bool_t p2m_valid(lpae_t pte) { return pte.p2m.valid; @@ -670,14 +678,6 @@ static bool_t is_mapping_aligned(const paddr_t start_gpaddr, #define P2M_ONE_PROGRESS_NOP 0x1 #define P2M_ONE_PROGRESS 0x10 -/* Helpers to lookup the properties of each level */ -static const paddr_t level_sizes[] = - { ZEROETH_SIZE, FIRST_SIZE, SECOND_SIZE, THIRD_SIZE }; -static const paddr_t level_masks[] = - { ZEROETH_MASK, FIRST_MASK, SECOND_MASK, THIRD_MASK }; -static const unsigned int level_shifts[] = - { ZEROETH_SHIFT, FIRST_SHIFT, SECOND_SHIFT, THIRD_SHIFT }; - static int p2m_shatter_page(struct p2m_domain *p2m, lpae_t *entry, unsigned int level)