From patchwork Mon Oct 9 13:23:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 115214 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp2557329qgn; Mon, 9 Oct 2017 06:26:01 -0700 (PDT) X-Google-Smtp-Source: AOwi7QDa3nTOP2JwVkx25imeB0Thm+Q/G5JO/LBZa5sxBzUWYN07So/5jtPSt3GMibtObZ85uvob X-Received: by 10.36.104.75 with SMTP id v72mr13390380itb.81.1507555561260; Mon, 09 Oct 2017 06:26:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507555561; cv=none; d=google.com; s=arc-20160816; b=MKsfcEv0E704jHrd2VmS6hg42lFZW3totjoEp7VetntubwnL5ui8smrq1daF/5nAdx sWh0yl+DNokTHUugwC2BZ2u+clIAsxjqPK96xpf4RcFUw78aJoG9yGY5hABA4cvGIfm/ BrrMRA+S0LglInkYhlqlA53k2xiyuaaOPDWlAcHo/+7spXBEDReMigKJxdiqJvergX9+ 3hsmzXZ52mKXVeb+TADPQtExJ4EseGZEoB9ldIjSFloKpEL9ieNZ4clE0dWFcTHtuDcI FzV3Rch0WG0MExEhzdb9w54SybYrlnm3wmwwrS+vtE1RPQk+Lqi194ILV4nONx94pVyL FvDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:cc:references:in-reply-to:message-id:date:to :from:arc-authentication-results; bh=Wcs+rxlnlRcfLRDyfRRQ5EqZMD7/EOdUrI+npvrjWcU=; b=0yBxZ/5OPaHwGzCM5VayUeGun4WGUl29jnau/LC2X6ehuTFIz8BjWQXhTGdHCb/9pz BTZuq5xKvqAdj19gAzuLG0QNa/iT1aIjAq67Oa2NCa8IpQeRJytcmExfSkhLJU8UHZwl zyvoHqU9ygEynSqOCO5/OrsuIrQT5gIegDg+f/2DrNXFRixuSCqy7NVIwV6jtcLXz0Ya 4TZ2B7z/TmeBcWvSdPUAyN765cqBJ8owh6IhOTIVgrc9Nuv5ok6pfAB+Y8iJnbijJjlB KttpDTAMJns24npj7MW3By7nNcOBhwUUScsI/dkdUzBu6kKMxa6Ns2vPABDwg/uP/Cum VB2w== ARC-Authentication-Results: i=1; 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 Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id w67si7422702itc.129.2017.10.09.06.26.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Oct 2017 06:26:01 -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 1e1Y2H-0007zv-Tp; Mon, 09 Oct 2017 13:23:57 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e1Y2F-0007y0-Tw for xen-devel@lists.xen.org; Mon, 09 Oct 2017 13:23:56 +0000 Received: from [85.158.143.35] by server-10.bemta-6.messagelabs.com id 6E/7A-03761-B687BD95; Mon, 09 Oct 2017 13:23:55 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrILMWRWlGSWpSXmKPExsVysyfVTTe94na kwbalNhZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa8bRGTEFF0Urvlw4ztjAuJ2/i5GLQ0hgM6PE yj19bBDOaUaJD3+msnYxcnKwCWhK3Pn8iQnEFhGQlrj2+TIjiM0sEClx+MMPdhBbGMh+sP8iG 4jNIqAqsbDtApjNK2AhMW/NYWYQW0JAXmJX20WwmZwClhLTNk8HiwsB1Vz+sIN1AiP3AkaGVY zqxalFZalFuuZ6SUWZ6RkluYmZObqGBmZ6uanFxYnpqTmJScV6yfm5mxiB3mUAgh2MMy/7H2K U5GBSEuWdUnA7UogvKT+lMiOxOCO+qDQntfgQowwHh5IEr305UE6wKDU9tSItMwcYZjBpCQ4e JRHeUJA0b3FBYm5xZjpE6hSjLkfHzbt/mIRY8vLzUqXEeX1BigRAijJK8+BGwEL+EqOslDAvI 9BRQjwFqUW5mSWo8q8YxTkYlYR5M0Cm8GTmlcBtegV0BBPQEYzFN0COKElESEk1MEbVyoYocX 2a9aTi2u671u19hxZFz1NjbJ1bfSZx++mcM8a836dcfnUh7PSdncvrw87WsX6Niey0cerd7n7 nzrLpRUtfzn/iNfOzjvbED3e4Ts84p+nk/qXx24InvsebZ/T937Nb+1ATo1EKc7ZARecO6YNf DNI0JnxXKTcLzSp63u7cZ6UZ+luJpTgj0VCLuag4EQBr0wO2dAIAAA== X-Env-Sender: julien.grall@arm.com X-Msg-Ref: server-11.tower-21.messagelabs.com!1507555431!73173855!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 19709 invoked from network); 9 Oct 2017 13:23:51 -0000 Received: from usa-sjc-mx-foss1.foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-11.tower-21.messagelabs.com with SMTP; 9 Oct 2017 13:23:51 -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 4371F1529; Mon, 9 Oct 2017 06:23:51 -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 580E43F578; Mon, 9 Oct 2017 06:23:50 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Mon, 9 Oct 2017 14:23:34 +0100 Message-Id: <20171009132341.1678-4-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171009132341.1678-1-julien.grall@arm.com> References: <20171009132341.1678-1-julien.grall@arm.com> Cc: andre.przywara@arm.com, Julien Grall , sstabellini@kernel.org Subject: [Xen-devel] [PATCH v4 03/10] 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" 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 */