From patchwork Mon Aug 14 14:24:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 110005 Delivered-To: patch@linaro.org Received: by 10.182.109.195 with SMTP id hu3csp4281581obb; Mon, 14 Aug 2017 07:26:17 -0700 (PDT) X-Received: by 10.107.11.205 with SMTP id 74mr19905028iol.303.1502720777718; 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=wjxUcxRa6oaWZucXYQpljjs6wVpsplAzfLIVwEo1R/gVCHKzueoLOM280qxMGzL9Yk Oy5xMGOc2qWwkzCD2BQMvajJ6BPeWcCL3XkTXUtHLIGfe/9EKz2khfeZyGGI5lQsAlCA LoNSyNjlNbfYq7/+4vVG2mn26jc84/pucdA6f1lgwJbUr6AdI2ZXvKvC2qRQEN4dKNdP +j8sJqZqEItAczy8KCpSytXKP/seeWA5Ihp/n7cx6wF2/khFDgPW4ABQf+VyZvTxafn/ bltsHmAvdaVXkNCR+tcB5zuTfqeAnyXuSsL70vDgOn9g9tq98JXfVUaduA9fX/YtgdRE rSIA== 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=l1GEE3Ytr5FB8ra+3RSMN4kVuB1lXomWJ1QMI1WJwfc=; b=YLBKFHeR9t8pvMvms5GmyFqx/thu2m+JxM7jfXLLY/D7eZyWABwvQmcZEpGQg6lU9L OhIAc5VzqGXsq6DqpiW6xR2MBYxUYM+c9XPKMA1Aqu6se8Eg+ueY2WMBKbQI50fqltmk bzAM6uncQo7VvKzim8AkvRi2O3jnw07gfSwITiI+xeJtMmZ4ledscUbGlybB21oFqtXM EJDgx0wW2cHeiontr9oT41x3/PXWOffiXGUPdqnJ9OGHx8ZmBDxXfNVYiPeRTIz8xIKK XHpPyLRIYkZThAGZjpw0TU+9jQNYd+reDff7c3qlH0pT5s/MgQybXsmZZrBaLFkBW5Pu 9glg== 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 z65si5317583itd.155.2017.08.14.07.26.17 (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 1dhGIj-00012S-G7; Mon, 14 Aug 2017 14:25:05 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dhGIi-0000yF-8L for xen-devel@lists.xen.org; Mon, 14 Aug 2017 14:25:04 +0000 Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id FD/12-22472-FB2B1995; Mon, 14 Aug 2017 14:25:03 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrMLMWRWlGSWpSXmKPExsVysyfVTXf/pom RBkdPMVss+biYxYHR4+ju30wBjFGsmXlJ+RUJrBkHd75nKvjCXdF97gxLA+MCzi5GLg4hgU2M Ek+ObWaDcE4zSpybeIe5i5GTg01AU+LO509MILaIgLTEtc+XGUFsZoFIicMffrCD2MICsRK/J u0Di7MIqEo0fTnLAmLzClhJPFv1CiwuISAvsavtIiuIzQkU77y7E6xGSMBS4sTq2WwTGLkXMD KsYtQoTi0qSy3SNTTSSyrKTM8oyU3MzNE1NDDWy00tLk5MT81JTCrWS87P3cQI9DADEOxgfNX tfIhRkoNJSZQ3wac3UogvKT+lMiOxOCO+qDQntfgQowwHh5IEb+rGiZFCgkWp6akVaZk5wFCD SUtw8CiJ8M4CSfMWFyTmFmemQ6ROMepyvJrw/xuTEEtefl6qlDhvOUiRAEhRRmke3AhY2F9il JUS5mUEOkqIpyC1KDezBFX+FaM4B6OSMO9mkCk8mXklcJteAR3BBHREH8j9vMUliQgpqQZGyU sXMt/Jvexm/mWzxlP3kMEsvi2SNvUuVyZGi/MYvFZmc/9y79JkG+sNKp13o2OXSWvXbgvUuiD LOU2jZnpQNju/F0O2QFV6l/mnLPbCO5Z/9l3fN0PhVHpkimma4aObe3j/sj3Ui0nJ9eh0WfXA auWE33NL1GvvTJbtWfv7PlNF1a9D28WVWIozEg21mIuKEwF1eKMLdgIAAA== X-Env-Sender: julien.grall@arm.com X-Msg-Ref: server-7.tower-31.messagelabs.com!1502720702!102389843!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 57337 invoked from network); 14 Aug 2017 14:25:02 -0000 Received: from usa-sjc-mx-foss1.foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-7.tower-31.messagelabs.com with SMTP; 14 Aug 2017 14:25:02 -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 4D4AE80D; Mon, 14 Aug 2017 07:25:02 -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 61A113F483; Mon, 14 Aug 2017 07:25:01 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Mon, 14 Aug 2017 15:24:15 +0100 Message-Id: <20170814142418.13267-25-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 24/27] xen/arm: page: Describe the layout of flags used to update page tables 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" Currently, the flags used to update page tables (i.e PAGE_HYPERVISOR_*) only contains the memory attribute index. Follow-up patches will add more information in it. At the same time introduce PAGE_AI_MASK to get the memory attribute index easily. Signed-off-by: Julien Grall Reviewed-by: Andre Przywara --- xen/arch/arm/mm.c | 2 +- xen/include/asm-arm/page.h | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c index 411fe02842..cd7bcf7aca 100644 --- a/xen/arch/arm/mm.c +++ b/xen/arch/arm/mm.c @@ -1021,7 +1021,7 @@ static int create_xen_entries(enum xenmap_operation op, } if ( op == RESERVE ) break; - pte = mfn_to_xen_entry(mfn, flags); + pte = mfn_to_xen_entry(mfn, PAGE_AI_MASK(flags)); pte.pt.table = 1; write_pte(entry, pte); break; diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h index d9dac92e73..1bf8e9d012 100644 --- a/xen/include/asm-arm/page.h +++ b/xen/include/asm-arm/page.h @@ -63,6 +63,13 @@ #define MAIR0VAL (MAIRVAL & 0xffffffff) #define MAIR1VAL (MAIRVAL >> 32) +/* + * Layout of the flags used for updating the hypervisor page tables + * + * [0:2] Memory Attribute Index + */ +#define PAGE_AI_MASK(x) ((x) & 0x7U) + #define PAGE_HYPERVISOR (MT_NORMAL) #define PAGE_HYPERVISOR_NOCACHE (MT_DEVICE_nGnRE) #define PAGE_HYPERVISOR_WC (MT_NORMAL_NC)