From patchwork Thu Sep 15 11:28:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 9333225 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 50C5E6077F for ; Thu, 15 Sep 2016 11:31:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3FE22295BA for ; Thu, 15 Sep 2016 11:31:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 34450295D5; Thu, 15 Sep 2016 11:31:26 +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 75455295BA for ; Thu, 15 Sep 2016 11:31:23 +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 1bkUqm-0004h0-AV; Thu, 15 Sep 2016 11:29:04 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bkUqk-0004fB-AQ for xen-devel@lists.xen.org; Thu, 15 Sep 2016 11:29:02 +0000 Received: from [85.158.139.211] by server-4.bemta-5.messagelabs.com id 77/B4-12285-DF58AD75; Thu, 15 Sep 2016 11:29:01 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrOLMWRWlGSWpSXmKPExsVysyfVTfdv661 wg0uzmSyWfFzM4sDocXT3b6YAxijWzLyk/IoE1oyD216wFMzjqTgy/SprA+Mfzi5GLg4hgU2M Eg1XD7JCOKcZJe493cjcxcjJwSagKXHn8ycmEFtEQFri2ufLjCBFzALtjBJr+3vBioQF4iWWf +1lAbFZBFQlOib/BLN5BVwljt3oALMlBOQkTh6bDLSBg4MTKL7kuShIWEjAReLYiZ1sExi5Fz AyrGLUKE4tKkst0jUy1ksqykzPKMlNzMzRNTQw1ctNLS5OTE/NSUwq1kvOz93ECPRwPQMD4w7 GHe1+hxglOZiURHnd0m6FC/El5adUZiQWZ8QXleakFh9ilOHgUJLg3dcClBMsSk1PrUjLzAGG GkxagoNHSYT3B0iat7ggMbc4Mx0idYpRUUocok8AJJFRmgfXBgvvS4yyUsK8jAwMDEI8BalFu ZklqPKvGMU5GJWEeVmB0SLEk5lXAjf9FdBiJqDFW9ZcB1lckoiQkmpgrNny97Izazu/+uyCvr zbomdjrt9doun5dJfFDR6z7TuDW269vxG1Lza0Y2pcrmiG27VbR1kOtO1fdT2l4dOFPTtu8pt vYr7kl+j7R5YxbrNbfNMOs8PCP+6/PLlQ+YS746N92kZb5i1Krolt4Syza5RlK5EM07y35o00 m+Cp551BPPO2JdrPUmIpzkg01GIuKk4EAMYAMs1qAgAA X-Env-Sender: julien.grall@arm.com X-Msg-Ref: server-11.tower-206.messagelabs.com!1473938940!47563611!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.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 13887 invoked from network); 15 Sep 2016 11:29:00 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-11.tower-206.messagelabs.com with SMTP; 15 Sep 2016 11:29:00 -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 4A22D7FD; Thu, 15 Sep 2016 04:29:00 -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 4A1723F251; Thu, 15 Sep 2016 04:28:59 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Thu, 15 Sep 2016 12:28:26 +0100 Message-Id: <1473938919-31976-11-git-send-email-julien.grall@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1473938919-31976-1-git-send-email-julien.grall@arm.com> References: <1473938919-31976-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] [for-4.8][PATCH v2 10/23] 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" X-Virus-Scanned: ClamAV using ClamSMTP 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 b4f75e8..413780b 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 uint8_t level_shifts[] = + { ZEROETH_SHIFT, FIRST_SHIFT, SECOND_SHIFT, THIRD_SHIFT }; + static bool_t p2m_valid(lpae_t pte) { return pte.p2m.valid; @@ -682,14 +690,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 uint8_t 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)