From patchwork Tue Aug 8 17:17:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 9888843 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D372D60363 for ; Tue, 8 Aug 2017 17:20:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AF0AF2892B for ; Tue, 8 Aug 2017 17:20:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9FB7B2895D; Tue, 8 Aug 2017 17:20:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 245052893A for ; Tue, 8 Aug 2017 17:20:18 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1df88S-0005oi-Ow; Tue, 08 Aug 2017 17:17:40 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1df88R-0005oS-Mw for xen-devel@lists.xen.org; Tue, 08 Aug 2017 17:17:39 +0000 Received: from [193.109.254.147] by server-6.bemta-6.messagelabs.com id C3/8E-03937-332F9895; Tue, 08 Aug 2017 17:17:39 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrILMWRWlGSWpSXmKPExsVysyfVTdfoU2e kwYmdshZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa8a6A4vYC27wVbzo/8/ewLiYp4uRi0NIYDOj xNPXv5khnNOMEjN7brB2MXJysAloStz5/IkJxBYRkJa49vkyI4jNLBAusWFCHwuILSwQINHTc AfMZhFQlVjYvJkdxOYVsJRYduIp2BwJAXmJXW0XWScwci5gZFjFqFGcWlSWWqRraKqXVJSZnl GSm5iZo2toYKaXm1pcnJiempOYVKyXnJ+7iRHoMQYg2MH4bVnAIUZJDiYlUd5N2p2RQnxJ+Sm VGYnFGfFFpTmpxYcYZTg4lCR4nT8C5QSLUtNTK9Iyc4ChA5OW4OBREuHlBknzFhck5hZnpkOk TjEac7ya8P8bE0fT94/fmYRY8vLzUqXEeQNASgVASjNK8+AGwUL6EqOslDAvI9BpQjwFqUW5m SWo8q8YxTkYlYR5l34AmsKTmVcCt+8V0ClMQKdE+IKdUpKIkJJqYHQ2mf30T+tOFQnt1Y9kP1 ZeZ9rCJHjQ5IIVv1Ku2O5AjdjrCx83n5je66R9zP96Ma9TjPHrrNs/59yy+l2owlzEvom7Itw t2kUu64N5rjLvgrCObTYRggor7r6O85r2yHv+9fd9ndmSj+/EHMxqc+l2exF3r+7ULAbDTIem f1WN18WjvQ8WK7EUZyQaajEXFScCALbhk8FkAgAA X-Env-Sender: julien.grall@arm.com X-Msg-Ref: server-14.tower-27.messagelabs.com!1502212658!98472699!1 X-Originating-IP: [217.140.101.70] X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 6693 invoked from network); 8 Aug 2017 17:17:38 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-14.tower-27.messagelabs.com with SMTP; 8 Aug 2017 17:17:38 -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 2A91015A2; Tue, 8 Aug 2017 10:17:37 -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 3D2893F540; Tue, 8 Aug 2017 10:17:36 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Tue, 8 Aug 2017 18:17:26 +0100 Message-Id: <20170808171726.28966-1-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 Cc: mark.rutland@arm.com, Julien Grall , sstabellini@kernel.org Subject: [Xen-devel] [PATCH] xen/arm: Tighten memory attribute requirement for memory shared 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" X-Virus-Scanned: ClamAV using ClamSMTP Xen allows shared mapping to be Normal inner-cacheable with any inner cache allocation strategy and no restriction of the outer-cacheability. However, Xen is always mapping those region Normal Inner Write-Back Outer Write-Back Inner-shareable. Per B2.8 "Mismatched memory attributes" in ARM DDI 0487B.a, if the guest is not using the exact same memory attributes (excluding any cache allocation hints) for the shared region then the region will be accessed with mismatched attributes. This will result to potential loss of coherency, and may impact the performance. Given that the ARM ARM strongly recommends to avoid using mismatched attributes, we should impose shared region to be Normal Inner Write-Back Outer Write-Back Inner-shareable. Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini --- xen/include/public/arch-arm.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h index bd974fb13d..8f9d06ef7f 100644 --- a/xen/include/public/arch-arm.h +++ b/xen/include/public/arch-arm.h @@ -61,15 +61,15 @@ * * All memory which is shared with other entities in the system * (including the hypervisor and other guests) must reside in memory - * which is mapped as Normal Inner-cacheable. This applies to: + * which is mapped as Normal Inner Write-Back Outer Write-Back Inner-Shareable. + * This applies to: * - hypercall arguments passed via a pointer to guest memory. * - memory shared via the grant table mechanism (including PV I/O * rings etc). * - memory shared with the hypervisor (struct shared_info, struct * vcpu_info, the grant table, etc). * - * Any Inner cache allocation strategy (Write-Back, Write-Through etc) - * is acceptable. There is no restriction on the Outer-cacheability. + * Any cache allocation hints are acceptable. */ /*