From patchwork Tue Jun 28 16:17:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 71110 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp1681656qgy; Tue, 28 Jun 2016 09:19:46 -0700 (PDT) X-Received: by 10.36.141.196 with SMTP id w187mr4590262itd.87.1467130786763; Tue, 28 Jun 2016 09:19:46 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id z69si24868547iod.137.2016.06.28.09.19.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Jun 2016 09:19:46 -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 1bHvhx-0007C2-T6; Tue, 28 Jun 2016 16:17:53 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bHvhw-00078T-AO for xen-devel@lists.xen.org; Tue, 28 Jun 2016 16:17:52 +0000 Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id F2/B6-29837-F23A2775; Tue, 28 Jun 2016 16:17:51 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrOLMWRWlGSWpSXmKPExsVysyfVTVd/cVG 4QeMeDoslHxezODB6HN39mymAMYo1My8pvyKBNePawxksBZ18FbuunGJtYHzL2cXIxSEksIlR 4tmRrWwQzmlGiR0/JzF1MXJysAloStz5/AnMFhGQlrj2+TIjiM0skClxae4vZhBbWCBBYkLXG rA4i4CqxNq9s8DqeQVcJZ78XgpmSwjISZw8NpkVxOYEim+Z8pMNxBYScJG4cOIGywRG7gWMDK sYNYpTi8pSi3SNTPSSijLTM0pyEzNzdA0NTPVyU4uLE9NTcxKTivWS83M3MQI9XM/AwLiD8eZ kv0OMkhxMSqK833qLwoX4kvJTKjMSizPii0pzUosPMcpwcChJ8MouAsoJFqWmp1akZeYAQw0m LcHBoyTCyw2S5i0uSMwtzkyHSJ1iVJQS57UCSQiAJDJK8+DaYOF9iVFWSpiXkYGBQYinILUoN 7MEVf4VozgHo5Iwrx/IFJ7MvBK46a+AFjMBLWatzgdZXJKIkJJqYMytk/y6yKRPYfqlimjHo/ kGV3Yzzn4TcyKrucLO7QqDCoemcezkAFUZyaI3J8Kknqhf1i74YLmNmfPuNlm33vIlUr9qPYz n3Y6IfN7g7ZYd8JhL4PabnaJzU+rrZKVuf5szfZHPjM5d5p9qRXoWOos9ZHkn9C/vBNst7i2q 1+Iaj/y6abohSomlOCPRUIu5qDgRABFoEFVqAgAA X-Env-Sender: julien.grall@arm.com X-Msg-Ref: server-8.tower-206.messagelabs.com!1467130670!47230455!1 X-Originating-IP: [217.140.101.70] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.46; banners=-,-,- X-VirusChecked: Checked Received: (qmail 827 invoked from network); 28 Jun 2016 16:17:50 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-8.tower-206.messagelabs.com with SMTP; 28 Jun 2016 16:17:50 -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 9B24FBA8; Tue, 28 Jun 2016 09:18:42 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.215.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 92F1B3F21A; Tue, 28 Jun 2016 09:17:49 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Tue, 28 Jun 2016 17:17:16 +0100 Message-Id: <1467130643-23868-11-git-send-email-julien.grall@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1467130643-23868-1-git-send-email-julien.grall@arm.com> References: <1467130643-23868-1-git-send-email-julien.grall@arm.com> Cc: Julien Grall , sstabellini@kernel.org, Shannon Zhao Subject: [Xen-devel] [PATCH v5 10/17] xen/arm: map_regions_rw_cache: Map the region with p2m->default_access 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 parameter 'access' is used by memaccess to restrict temporarily the permission. This parameter should not be used for other purpose (such as restricting permanently the permission). The type p2m_mmio_direct will map the region Read-Write and non-executable. Note that this is already the current behavior with the combination of the type and the access. So there is no functional change. Signed-off-by: Julien Grall --- Cc: Shannon Zhao This patch is a candidate for Xen 4.7. Currently this function is only used to map ACPI regions. I am wondering if we should introduce a new p2m type for it. And map this region RO (I am not sure why a guest would want to modify this region). Changes in v4: - Patch added --- xen/arch/arm/p2m.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index 1cfb62b..fcc4513 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -1231,7 +1231,7 @@ int map_regions_rw_cache(struct domain *d, pfn_to_paddr(start_gfn + nr), pfn_to_paddr(mfn), MATTR_MEM, 0, p2m_mmio_direct, - p2m_access_rw); + d->arch.p2m.default_access); } int unmap_regions_rw_cache(struct domain *d, @@ -1244,7 +1244,7 @@ int unmap_regions_rw_cache(struct domain *d, pfn_to_paddr(start_gfn + nr), pfn_to_paddr(mfn), MATTR_MEM, 0, p2m_invalid, - p2m_access_rw); + d->arch.p2m.default_access); } int map_mmio_regions(struct domain *d,