From patchwork Thu Sep 15 11:28:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 9333201 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 67C9D6089F for ; Thu, 15 Sep 2016 11:30:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 545A8295C6 for ; Thu, 15 Sep 2016 11:30:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4547C295D1; Thu, 15 Sep 2016 11:30:58 +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 C4775295C6 for ; Thu, 15 Sep 2016 11:30:57 +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 1bkUql-0004fn-3a; Thu, 15 Sep 2016 11:29:03 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bkUqj-0004eZ-5b for xen-devel@lists.xen.org; Thu, 15 Sep 2016 11:29:01 +0000 Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id 9B/E7-03271-CF58AD75; Thu, 15 Sep 2016 11:29:00 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrOLMWRWlGSWpSXmKPExsVysyfVTfd3661 wg1WTjSyWfFzM4sDocXT3b6YAxijWzLyk/IoE1oxNc3pYC3ZyVuydsJa5gXEDexcjF4eQwCZG iWsbvrNCOKcZJea3LmTqYuTkYBPQlLjz+ROYLSIgLXHt82VGkCJmgXZGibX9vcwgCWGBDInN/ c9YQWwWAVWJ2dsesIDYvAKuEisnvAOrkRCQkzh5bDJQDQcHJ1B8yXNRkLCQgIvEsRM72SYwci 9gZFjFqFGcWlSWWqRraKmXVJSZnlGSm5iZo2toYKyXm1pcnJiempOYVKyXnJ+7iRHo4XoGBsY djL+P+x1ilORgUhLldUu7FS7El5SfUpmRWJwRX1Sak1p8iFGGg0NJgndfC1BOsCg1PbUiLTMH GGowaQkOHiUR3h8gad7igsTc4sx0iNQpRkUpcYg+AZBERmkeXBssvC8xykoJ8zIyMDAI8RSkF uVmlqDKv2IU52BUEuY9AjKFJzOvBG76K6DFTECLt6y5DrK4JBEhJdXAmM2atY/7iXz5Pov0zm 2MPBdNv1/mrYq5cVf9xC7zp/t6nHTjluVeec/BdeWfhb9L9F81Zcdzr5Qt2ZgajQOslk0yalh QXjsl4klH16M3d8++TN5d4FvkGDop4c7U+Mxfh0QCeR45yz67F/rGgWOumKK8wns+tXN6J38a zbNNc3ngV/yn+AmjEktxRqKhFnNRcSIAF9IJ+GoCAAA= X-Env-Sender: julien.grall@arm.com X-Msg-Ref: server-8.tower-31.messagelabs.com!1473938939!60964448!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.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 10489 invoked from network); 15 Sep 2016 11:28:59 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-8.tower-31.messagelabs.com with SMTP; 15 Sep 2016 11:28:59 -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 0FB1F7FC; Thu, 15 Sep 2016 04:28:59 -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 0F2113F251; Thu, 15 Sep 2016 04:28:57 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Thu, 15 Sep 2016 12:28:25 +0100 Message-Id: <1473938919-31976-10-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 09/23] xen/arm: p2m: Change the type of level_shifts from paddr_t to uint8_t 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 The level shift can be encoded with 8-bit. So it is not necessary to use paddr_t (i.e 64-bit). Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini --- Changes in v2: - Use uint8_t rather than unsigned int - Replaced paddr_t by uint8_t in p2m_shatter_page --- xen/arch/arm/p2m.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index b53d4cf..b4f75e8 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -687,14 +687,14 @@ 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 paddr_t level_shifts[] = +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) { - const paddr_t level_shift = level_shifts[level]; + const uint8_t level_shift = level_shifts[level]; int rc = p2m_create_table(p2m, entry, level_shift - PAGE_SHIFT); if ( !rc )