From patchwork Mon Aug 14 14:24:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 110004 Delivered-To: patch@linaro.org Received: by 10.182.109.195 with SMTP id hu3csp4281570obb; Mon, 14 Aug 2017 07:26:17 -0700 (PDT) X-Received: by 10.107.3.143 with SMTP id e15mr21505633ioi.308.1502720777082; Mon, 14 Aug 2017 07:26:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502720777; cv=none; d=google.com; s=arc-20160816; b=gfZp9yfbP4aPOSZonjae3E9CEuboOYo4H6VR2fkEhxACUQj2R6knna93ExBWtNSRg5 mNLNdhuL5RbtSdWZDVbmdNvYhoJA180e9fysoNj9LdTcfQhf53kBGkh0213JPtgVnH9f PTjcL94gbe01bvtVKzyIErDHdPqmEkW+s7EhesoRALNSsdjf4qqRPo4Bm4Frsmk9X0xv LSdngGX6gZD61F58xtmAml2boSCxYrpA+qIPkVLqgm++oA2Zze+YyiZuzEIKLEwg1weE 8X+p8E41pubJCA9QLu2d/0aAbw9dvLx/6DXFQni4tF7rCULCvun6rgTaBqfouEakWaOm n3bA== 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=5pKfDoMOjdhF+eq7Q1+jI/QOrBf95mggZEVoYszUKvI=; b=DJs3gFqymgJ89PC0IQeq1cw7noqS/8GtlFchFcD/cUEBRgWRyz9+BLHqdpZZooUPn1 XPakjxACCDsyaDYA2ces+vUOdUo/F0IRrk6OUjSSIaSyHl7NSbcn7jA+axY1S8Mu4UAY 0Baxj6Wdt+KeFZ2l6nbicIVI0BFZVcUz6rZB4+j0uVbyRyEgVSlsNXQ4pYXhvr6Yw1x3 MZ++N6wMfF5S2Jc9mvVAXOgsuei5hSA7CtUMaiBUJ3StNMK7UFnYIiqTnqSo0K7gbN+e cApRaI2cEqEufUmZfaj6x5/vxRmEhYoSYnLLKtfjcXwld33uLLGogXXbjGLzevd8K5zl QAyw== 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 e190si5448991itg.50.2017.08.14.07.26.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Aug 2017 07:26:17 -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 1dhGIg-0000ta-Ab; Mon, 14 Aug 2017 14:25:02 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dhGIe-0000pI-SI for xen-devel@lists.xen.org; Mon, 14 Aug 2017 14:25:00 +0000 Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id 59/30-01994-CB2B1995; Mon, 14 Aug 2017 14:25:00 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrMLMWRWlGSWpSXmKPExsVysyfVTXf3pom RBpdmKlss+biYxYHR4+ju30wBjFGsmXlJ+RUJrBm7f7xiKfguXHHoykHmBsY+vi5GLg4hgc2M Em/XPmOBcE4zSuyaeYmxi5GTg01AU+LO509MILaIgLTEtc+XweLMApEShz/8YAexhQXCJE7ve MMGYrMIqEpsevEULM4rYCXxf+0tsHoJAXmJXW0XWUFsTqB4592dLCC2kIClxInVs9kmMHIvYG RYxahRnFpUllqka2Shl1SUmZ5RkpuYmaNraGCql5taXJyYnpqTmFSsl5yfu4kR6OF6BgbGHYx 9q/wOMUpyMCmJ8ib49EYK8SXlp1RmJBZnxBeV5qQWH2KU4eBQkuBN3TgxUkiwKDU9tSItMwcY ajBpCQ4eJRHeWSBp3uKCxNzizHSI1ClGXY5XE/5/YxJiycvPS5US5y0HKRIAKcoozYMbAQv7S 4yyUsK8jAwMDEI8BalFuZklqPKvGMU5GJWEeTeDTOHJzCuB2/QK6AgmoCP6QO7nLS5JREhJNT CG9Bwrj5ern7fw5qy3xwo7Ltf/93ojvWHr1EmHlI/GP70785H+3lXrrdUaGXSc1aeolQW3s21 xfSNrvMDq7WqJyuUWPI8y4ue1fzOPTbrAJr1tfqNy5lr1NtPbtrymyv4bv9lt5s2YZfYwYmXe dhPelKCHsufWcDQFPvzFcnL2JZFsXv6CD85KLMUZiYZazEXFiQDi1kFfdgIAAA== X-Env-Sender: julien.grall@arm.com X-Msg-Ref: server-5.tower-206.messagelabs.com!1502720699!105578703!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 62508 invoked from network); 14 Aug 2017 14:24:59 -0000 Received: from usa-sjc-mx-foss1.foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-5.tower-206.messagelabs.com with SMTP; 14 Aug 2017 14:24: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 C255A1991; Mon, 14 Aug 2017 07:24:58 -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 D6CA33F483; Mon, 14 Aug 2017 07:24:57 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Mon, 14 Aug 2017 15:24:12 +0100 Message-Id: <20170814142418.13267-22-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170814142418.13267-1-julien.grall@arm.com> References: <20170814142418.13267-1-julien.grall@arm.com> Cc: andre.przywara@arm.com, Julien Grall , sstabellini@kernel.org Subject: [Xen-devel] [PATCH 21/27] 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 --- 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 ce1858fbf3..c0d5fda269 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 a62b118630..9402434c1e 100644 --- a/xen/include/asm-arm/lpae.h +++ b/xen/include/asm-arm/lpae.h @@ -33,7 +33,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 */