From patchwork Tue Sep 12 10:03:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 9948871 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 3DFEB603F3 for ; Tue, 12 Sep 2017 10:06:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2CF5928EC3 for ; Tue, 12 Sep 2017 10:06:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 220E528EDA; Tue, 12 Sep 2017 10:06:02 +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 7BDD928ECF for ; Tue, 12 Sep 2017 10:06:01 +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 1dri32-0003FH-7o; Tue, 12 Sep 2017 10:04:04 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dri31-0003Cn-Jm for xen-devel@lists.xen.org; Tue, 12 Sep 2017 10:04:03 +0000 Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id 65/DB-02044-211B7B95; Tue, 12 Sep 2017 10:04:02 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrILMWRWlGSWpSXmKPExsVysyfVTVdo4/Z Ig2lTWC2WfFzM4sDocXT3b6YAxijWzLyk/IoE1oxJa/ULnotUvJ99g62B8QlfFyMXh5DAZkaJ hs+T2SCc04wSSzevZu9i5ORgE9CUuPP5ExOILSIgLXHt82VGEJtZIFLi8IcfYDXCQPbqpa3MI DaLgKrEikOrWEFsXgFLiZZD98DiEgLyErvaLoLFOYHiKz7+YgOxhQQsJL6//ME4gZF7ASPDKk b14tSistQiXUu9pKLM9IyS3MTMHF1DA2O93NTi4sT01JzEpGK95PzcTYxA79YzMDDuYHz90+k QoyQHk5Io75H12yOF+JLyUyozEosz4otKc1KLDzHKcHAoSfCybwDKCRalpqdWpGXmAMMMJi3B waMkwisEkuYtLkjMLc5Mh0idYtTl6Lh59w+TEEtefl6qlDjvG5D5AiBFGaV5cCNgIX+JUVZKm JeRgYFBiKcgtSg3swRV/hWjOAejkjCvHMgqnsy8ErhNr4COYAI6gufSFpAjShIRUlINjGtXC7 qVHzq9ad1C/yOWcwW/i7WeD9zLnRE96Xm8doBV3u7PwsfuupVnTJeo9Pi3v3DdS62v72+bvlx wX6Yr+lS1x+IynrOvVTxX3bvfPfF45/u8+3M18h3shJdqLDFd916kM25t7jF7/wVx04P81nWk /5vfadR9JM/ipP6ejx/WheZaF0d80FdiKc5INNRiLipOBACPrhC5dAIAAA== X-Env-Sender: julien.grall@arm.com X-Msg-Ref: server-5.tower-31.messagelabs.com!1505210641!111127284!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 20744 invoked from network); 12 Sep 2017 10:04:01 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-5.tower-31.messagelabs.com with SMTP; 12 Sep 2017 10:04: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 50B57165D; Tue, 12 Sep 2017 03:04:01 -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 622673F578; Tue, 12 Sep 2017 03:04:00 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Tue, 12 Sep 2017 11:03:24 +0100 Message-Id: <20170912100330.2168-19-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170912100330.2168-1-julien.grall@arm.com> References: <20170912100330.2168-1-julien.grall@arm.com> Cc: andre.przywara@arm.com, Julien Grall , sstabellini@kernel.org Subject: [Xen-devel] [PATCH v2 18/24] 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 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 fc76f03526..b3286b4a89 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 */