From patchwork Mon Jun 27 16:54:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 70939 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp1167552qgy; Mon, 27 Jun 2016 09:56:30 -0700 (PDT) X-Received: by 10.107.47.214 with SMTP id v83mr1800102iov.154.1467046587331; Mon, 27 Jun 2016 09:56:27 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id z67si8389974itf.88.2016.06.27.09.56.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Jun 2016 09:56:27 -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 1bHZnx-0005g5-Lb; Mon, 27 Jun 2016 16:54:37 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bHZnw-0005cw-0u for xen-devel@lists.xen.org; Mon, 27 Jun 2016 16:54:36 +0000 Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id C4/2C-16470-B4A51775; Mon, 27 Jun 2016 16:54:35 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrOLMWRWlGSWpSXmKPExsVysyfVTdcrqjD coPWftsWSj4tZHBg9ju7+zRTAGMWamZeUX5HAmrHi2QGWgk6+iiVPb7M2ML7l7GLk4hAS2MQo 8fr6axYI5zSjxME1P9m6GDk52AQ0Je58/sQEYosISEtc+3yZEcRmFqiXuDl5KwuILSyQIHGi6 yGYzSKgKrGtcy4ziM0r4CIx/8cysDkSAnISJ49NZgWxOYHiey8sBasREnCWODjtO/sERu4FjA yrGDWKU4vKUot0DS31kooy0zNKchMzc3QNDYz1clOLixPTU3MSk4r1kvNzNzECPVzPwMC4g/H 3cb9DjJIcTEqivNse5YYL8SXlp1RmJBZnxBeV5qQWH2KU4eBQkuB9HlEYLiRYlJqeWpGWmQMM NZi0BAePkgjvd5A0b3FBYm5xZjpE6hSjopQ4r1IkUEIAJJFRmgfXBgvvS4yyUsK8jAwMDEI8B alFuZklqPKvGMU5GJWEeT1BpvBk5pXATX8FtJgJaDFrdT7I4pJEhJRUA6NI4LQw9b93Uz8lrp zy19tzkfBS55aCzA8Zp//oZc3sKP+UaGsal6o892Z0CF9H35KnjsUzTu/c/OkjX76C0e/iMx6 8e45sWcHovP3k3CXXNMTe7q6X+bwrMerng4JFK2Nf9y19LBSSPGE3w7ZFmoJCM8+/iHL/6Zv7 98+VFTn+mrYnsvkN3XYosRRnJBpqMRcVJwIAwbguLGoCAAA= X-Env-Sender: julien.grall@arm.com X-Msg-Ref: server-3.tower-31.messagelabs.com!1467046474!47529714!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 11378 invoked from network); 27 Jun 2016 16:54:34 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-3.tower-31.messagelabs.com with SMTP; 27 Jun 2016 16:54:34 -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 590F8433; Mon, 27 Jun 2016 09:55:25 -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 0858B3F246; Mon, 27 Jun 2016 09:54:32 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Mon, 27 Jun 2016 17:54:05 +0100 Message-Id: <1467046452-1261-10-git-send-email-julien.grall@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1467046452-1261-1-git-send-email-julien.grall@arm.com> References: <1467046452-1261-1-git-send-email-julien.grall@arm.com> Cc: Julien Grall , sstabellini@kernel.org, Shannon Zhao , wei.chen@linaro.org Subject: [Xen-devel] [PATCH v4 09/16] 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 1a10019..4f3564f 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,