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: 114630 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp924536qgn; Mon, 2 Oct 2017 10:34:02 -0700 (PDT) X-Google-Smtp-Source: AOwi7QBNxgdOCfSERvyyGncqBct+ReH3h0vVPL+E/8XdDFnaTqCDbBTrmwTJc03VJaJ1vgmMvNGo X-Received: by 10.36.46.140 with SMTP id i134mr18640031ita.137.1506965642100; Mon, 02 Oct 2017 10:34:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506965642; cv=none; d=google.com; s=arc-20160816; b=aQFTt1OhEeEmDJZxwaDq3k1XtPCQeRuZH7a9q3sC1mAaq7LJZiAAmd5zP0/4WF0BuG FRsglM48LjQCiGdcSG9KQAK4wRqa0bS9xGlkXIofBkzzLyvq0UDgdUfD1/U+ZJXcoeGl BJt6IHTK2XEly7gVsj3Lh9PCh3aSRdUqZ/tgOiWCVl9vsz3ZBuHpJD2VTLdhfnHbM7Ze PPfu/5A+s90x6jtlpA85GYTUUu4EZ/kNp2vT5gJp5/6lreUaU2RkaURX7e9aOo6DYqiO MZyTvvnKxWoKCZS1xZoX5B+Ur3+vpXgZ10+0BKaNcu2fLSQ1n9pwsxgASOyVwL4RNvtx YfLA== 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=MTXWRcvjqp7gb/FDdP4/WwJdyttCAFxuIHn5Kopu+77CgAGiR+M6r9xDcEEB31EzFK cY2eZq5cZeOe8XgbkZ40dIPIpmqvHs/zJdOfaDRXYvdihE5rHabckKuGQVqm/20BnTKn n9CdYEha1PcAscbDa+WR+oh28rygfhuez3vDDYSk99teFs1rLlY+PfEzxMZJtk43RkUy rl7sxyDizvuGrS3QZdqH84yPWkZS0WTI2Lmydbewz2ob1lcVPUIe7qmC/khhp8hVUfNK WGZ+zy/1PBoBRjd/O9Ff9VlEIdSiKrKnr/P+f9iL0VccVTR4Zf7CSVNG8nNkzqM95xgY vO5A== 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 k9si4178087ith.76.2017.10.02.10.34.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Oct 2017 10:34:02 -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 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" 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 */