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: 112263 Delivered-To: patch@linaro.org Received: by 10.80.202.13 with SMTP id d13csp5674066edi; Tue, 12 Sep 2017 03:05:25 -0700 (PDT) X-Google-Smtp-Source: AOwi7QDL93BB63Q0o5oNJ/PoVCStjK03fha5RblQrqCspYU5bqsasJkqxuOd3s5VU19FfN6jHsfn X-Received: by 10.36.152.133 with SMTP id n127mr262181itd.17.1505210725604; Tue, 12 Sep 2017 03:05:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505210725; cv=none; d=google.com; s=arc-20160816; b=Ge7baedBjKfpJafpzqHi0r9/KdHw8HDuVweN593je0R7riVrkeIAXw8uL1u+ZTdr1S h88R3FqpwJBX5kHU5VVMAxZygDb+5DSA1EfAl7bPxaEgnQx+VGJjxyyOp3AKTQROTeDY uIFSWTPSAi2SeOvgJ9yTsmjceEBy8ZEf3DQeLv96+EvOhGqXR+oFLBA4hABqxSxHyC0J uGblRgZ3wTu2NIm+HgbeiWXjpolL5AfGn8PO7XtQSy3aLG+MQcCQNOYNH08298wsG/HR ZzbotAQTZzhO9aZnQJvNbyEfkTWcF4nhOxPwh2s84m+LBwjOo6jXSwp0e15SlcOXUGid o8UQ== 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=i5yp3SYgCHONVnE0HiL1vax+I6H3fp/DnqqNexix6+c=; b=o1W8NiucVYy2T2swSPQoyCgdp0Dqc3gGCchVxNstV6uMn8n2qO1kdSvruE29wehOt8 Hj7b/IGU+bA2c4PKZox9HNd4I7iivCIGMz/QxR72XCv1JIbrX03zlzb+HtUv5bfLcowW GKhBbCPKLcD6VzOdBVpWpfT7lYNc/XPsO/L4qRQWih9p5NrGWS8JG1B84uDtH2LV7Vnt 1G1tNeQHfDtZvvJS+gPEqDskDlOSx/656yMhZi7c/xsoKfEmmikv5uipCClmwBEGIwjb kgPuWZKSh7hoa3ZMGOUDhbH/2BYsrza8TkabIf7fUGshaCFK0qLdFrFFZsHJft3N/zYL hdyA== 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 s206si11066872itd.200.2017.09.12.03.05.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Sep 2017 03:05:25 -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 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" 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 */