From patchwork Mon Oct 2 17:31:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 9981047 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 1E39E60384 for ; Mon, 2 Oct 2017 17:34:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 09F9C25D9E for ; Mon, 2 Oct 2017 17:34:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F2E2B26CFF; Mon, 2 Oct 2017 17:34:19 +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 4332725D9E for ; Mon, 2 Oct 2017 17:34:17 +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 1dz4ZX-0003Zp-Ov; Mon, 02 Oct 2017 17:32:03 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dz4ZW-0003Yb-5Y for xen-devel@lists.xen.org; Mon, 02 Oct 2017 17:32:02 +0000 Received: from [193.109.254.147] by server-5.bemta-6.messagelabs.com id 8E/29-03454-11872D95; Mon, 02 Oct 2017 17:32:01 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrILMWRWlGSWpSXmKPExsVysyfVTVew4lK kwa3/4hZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa8bRGTEFF0Urvlw4ztjAuJ2/i5GLQ0hgM6PE +V972CCc04wSyyfPY+li5ORgE9CUuPP5ExOILSIgLXHt82VGEJtZIFLi8Icf7F2MHBzCAuESV 19EgYRZBFQlbr9tYgWxeQUsJF5dXswOYksIyEvsarsIFucUsJS4/eQQM4gtBFRz+vUMpgmM3A sYGVYxahSnFpWlFukaGeolFWWmZ5TkJmbm6BoamOnlphYXJ6an5iQmFesl5+duYgR6lwEIdjD +WRZwiFGSg0lJlNc7/1KkEF9SfkplRmJxRnxRaU5q8SFGGQ4OJQne62VAOcGi1PTUirTMHGCY waQlOHiURHgjy4HSvMUFibnFmekQqVOMuhwdN+/+YRJiycvPS5US5zUCKRIAKcoozYMbAQv5S 4yyUsK8jEBHCfEUpBblZpagyr9iFOdgVBLm/QNyCU9mXgncpldARzABHTGn6wLIESWJCCmpBk YTtYNeq5/MqXivx8r5zaH9VF6P5pfaqp7dJR/ZzS68vbffQXrfjwzNiYv4bh8UXsYoerlqatz mX+muM5ujXDj2amb1aNzI6dxxiyPoq9s+oQnsfiKps1vubFnzqaJ6w8fn7mUxeilr+I5dNJvJ JHc3fbPi63WLjQyCv07nmzan8Fyo+7/C7CwlluKMREMt5qLiRABYRcrodAIAAA== X-Env-Sender: julien.grall@arm.com X-Msg-Ref: server-16.tower-27.messagelabs.com!1506965520!119253324!1 X-Originating-IP: [217.140.101.70] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 52338 invoked from network); 2 Oct 2017 17:32:01 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-16.tower-27.messagelabs.com with SMTP; 2 Oct 2017 17:32:01 -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 9FCCB1596; Mon, 2 Oct 2017 10:32:00 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.206.53]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B47483F483; Mon, 2 Oct 2017 10:31:59 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Mon, 2 Oct 2017 18:31:44 +0100 Message-Id: <20171002173150.5404-4-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171002173150.5404-1-julien.grall@arm.com> References: <20171002173150.5404-1-julien.grall@arm.com> Cc: andre.przywara@arm.com, Julien Grall , sstabellini@kernel.org Subject: [Xen-devel] [PATCH v3 3/9] xen/arm: mm: Rename and clarify AP[1] in the stage-1 page table 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 description of AP[1] in Xen is based on testing rather than the ARM ARM. Per the ARM ARM, on EL2 stage-1 page table, AP[1] is RES1 as the translation regime applies to only one exception level (see D4.4.4 and G4.6.1 in ARM DDI 0487B.a). Update the comment and also rename the field to match the description in the ARM ARM. Signed-off-by: Julien Grall Reviewed-by: Andre Przywara Acked-by: Stefano Stabellini --- Changes in v3: - Add Stefano's acked-by Changes in v2: - Add Andre's reviewed-by --- xen/arch/arm/mm.c | 10 +++++----- xen/include/asm-arm/lpae.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c index f41c6ce6f1..73677902d4 100644 --- a/xen/arch/arm/mm.c +++ b/xen/arch/arm/mm.c @@ -273,7 +273,7 @@ static inline lpae_t mfn_to_xen_entry(mfn_t mfn, unsigned attr) .table = 0, /* Set to 1 for links and 4k maps */ .ai = attr, .ns = 1, /* Hyp mode is in the non-secure world */ - .user = 1, /* See below */ + .up = 1, /* See below */ .ro = 0, /* Assume read-write */ .af = 1, /* No need for access tracking */ .ng = 1, /* Makes TLB flushes easier */ @@ -282,10 +282,10 @@ static inline lpae_t mfn_to_xen_entry(mfn_t mfn, unsigned attr) .avail = 0, /* Reference count for domheap mapping */ }}; /* - * Setting the User bit is strange, but the ATS1H[RW] instructions - * don't seem to work otherwise, and since we never run on Xen - * pagetables in User mode it's OK. If this changes, remember - * to update the hard-coded values in head.S too. + * For EL2 stage-1 page table, up (aka AP[1]) is RES1 as the translation + * regime applies to only one exception level (see D4.4.4 and G4.6.1 + * in ARM DDI 0487B.a). If this changes, remember to update the + * hard-coded values in head.S too. */ switch ( attr ) diff --git a/xen/include/asm-arm/lpae.h b/xen/include/asm-arm/lpae.h index 118ee5ae1a..b30853e79d 100644 --- a/xen/include/asm-arm/lpae.h +++ b/xen/include/asm-arm/lpae.h @@ -35,7 +35,7 @@ typedef struct __packed { */ unsigned long ai:3; /* Attribute Index */ unsigned long ns:1; /* Not-Secure */ - unsigned long user:1; /* User-visible */ + unsigned long up:1; /* Unpriviledged access */ unsigned long ro:1; /* Read-Only */ unsigned long sh:2; /* Shareability */ unsigned long af:1; /* Access Flag */