From patchwork Wed Jul 6 13:01:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 71464 Delivered-To: patch@linaro.org Received: by 10.140.28.4 with SMTP id 4csp854458qgy; Wed, 6 Jul 2016 06:04:46 -0700 (PDT) X-Received: by 10.107.164.211 with SMTP id d80mr17547004ioj.130.1467810285142; Wed, 06 Jul 2016 06:04:45 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id l12si3565480iod.67.2016.07.06.06.04.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Jul 2016 06:04:45 -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 1bKmSc-0000Vc-4A; Wed, 06 Jul 2016 13:01:50 +0000 Received: from mail6.bemta6.messagelabs.com ([85.158.143.247]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bKmSb-0000Ur-Jr for xen-devel@lists.xen.org; Wed, 06 Jul 2016 13:01:49 +0000 Received: from [85.158.143.35] by server-1.bemta-6.messagelabs.com id 46/D8-09256-C310D775; Wed, 06 Jul 2016 13:01:48 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrCLMWRWlGSWpSXmKPExsVysyfVTdeGsTb c4PxnBYslHxezODB6HN39mymAMYo1My8pvyKBNePsN/WCKQIVT27cZ21gPMzdxcjFISSwiVHi wMKjzBDOaUaJxvu7gRxODjYBTYk7nz8xgdgiAtIS1z5fZgSxmQUyJS7N/QVUw8EhLJAgMXM/J 0iYRUBVortlLiuIzSvgInF+6j+wVgkBOYmTxyaDxTkFXCWmX3vMDmILAdVsXzyJeQIj9wJGhl WM6sWpRWWpRbpGeklFmekZJbmJmTm6hgZmermpxcWJ6ak5iUnFesn5uZsYgb5lAIIdjMv+Oh1 ilORgUhLlZflWHS7El5SfUpmRWJwRX1Sak1p8iFGGg0NJglefoTZcSLAoNT21Ii0zBxhkMGkJ Dh4lEd4YkDRvcUFibnFmOkTqFKOilDgvH0hCACSRUZoH1wYL7EuMslLCvIxAhwjxFKQW5WaWo Mq/YhTnYFQS5vX7XxMuxJOZVwI3/RXQYiagxT9dqkEWlyQipKQaGIUDm/6fOxtzZUKbpuO9C6 5L+ZOaWFXmnu6Vnp+VGeAz/fzWVSf9vuv7C7KpRty3VNsszdDWsJ4l+5dPLtf37TNjnRjlq3p /NX/8YKnOkhfG8qd30ZP9jzvtOs5mNf1ezOgf8q/828nCDIF5eeu2fjuuK7xyh8lux7mv1Dll JmjwRd64u3DVBiWW4oxEQy3mouJEALCRt4xnAgAA X-Env-Sender: julien.grall@arm.com X-Msg-Ref: server-12.tower-21.messagelabs.com!1467810108!22669812!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.77; banners=-,-,- X-VirusChecked: Checked Received: (qmail 35991 invoked from network); 6 Jul 2016 13:01:48 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-12.tower-21.messagelabs.com with SMTP; 6 Jul 2016 13:01:48 -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 82C64BB1; Wed, 6 Jul 2016 06:02:31 -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 D69B03F21A; Wed, 6 Jul 2016 06:01:31 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Wed, 6 Jul 2016 14:01:06 +0100 Message-Id: <1467810073-27971-8-git-send-email-julien.grall@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1467810073-27971-1-git-send-email-julien.grall@arm.com> References: <1467810073-27971-1-git-send-email-julien.grall@arm.com> Cc: Julien Grall , sstabellini@kernel.org, Shannon Zhao Subject: [Xen-devel] [PATCH v6 07/14] 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). Instead, we should use the default access requested by memacess. When it is not enabled, the access will be p2m_access_rwx (i.e no restriction applied). The type p2m_mmio_direct will map the region read-write and non-executable before any further restriction by memaccess. Note that this is already the resulting permission with the curreent 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 v2: - Reword the commit message 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,