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: 109670 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp3234700qge; Tue, 8 Aug 2017 10:19:31 -0700 (PDT) X-Received: by 10.36.36.142 with SMTP id f136mr4405643ita.32.1502212771750; Tue, 08 Aug 2017 10:19:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1502212771; cv=none; d=google.com; s=arc-20160816; b=evUmD6O2c68lIFVhP2vnDWlEr4XdqserpJy14/YMNRIOQ5nbwVXwxsTe48n2cV5jc4 Gl5NHr4Qhex8yzvBc0z6An+HXSTfBSLQu6wcf0ZTKJ2ZeDRS7/qTF5hDemUSugk4a62d NtwPX2fRarlnAxu3CLDAo9svh0y0L8sZJiCx1a5s8472hc1t20Mt9pu2du7t1tNWa9dg TvweCv4UGt4vPZYCgq/UweqjTXcmGx4GQaOCaemlVbmO/Hn9DpD6UL3L/vbSrys1RjAc LlOU/S11fa/AOVm9PYz5x2lAJkL51ddQShB9rTvpEGzcGtHtPXI7siKLXjFan2Kbmbpg YZ7Q== 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:message-id:date:to:from :arc-authentication-results; bh=sGqHxoAnvoIXF0KwpaRAS+JDXLJGAyzZlIXq4yRDxHw=; b=c21ZhKhS4M7KA85A1AvxQ4fEqfMZ22kZo7GNgOLljtie5MPe/JrfEHLfCBU/hhxlDl Ql5jAkbJsMk4Wwm1I+VWZMef/8f2tF57fYbhl/vP+igwRBwTTWtVOWKEewbHCBLKLMEx 2THcaFfyN+PuBJp0tDHxZaZYNyBs5PMjaRHfmwSC/rFCRCxiQ/bD2fsTfgIvS6qI5Dyx AvXw3Aq6vsKBzW48OzWOmlIK6k/p/BHmiJOIT8iSDypq2Aivk7CWJjH5djNE9PSdqHpW cDLELuP2aSg4c7N+wpwduIWAbogIPR29SIHW0KY9wsZ1+qeLvTVtCTPVA3cv5ihIrZ/R 3DHA== 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 78si2091222ita.40.2017.08.08.10.19.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Aug 2017 10:19:31 -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 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" 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. */ /*