From patchwork Wed May 24 18:01:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Philippe Brucker X-Patchwork-Id: 9746737 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 E2ED8601C2 for ; Wed, 24 May 2017 18:12:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB77628990 for ; Wed, 24 May 2017 18:12:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D01C8289C7; Wed, 24 May 2017 18:12:57 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 769F728990 for ; Wed, 24 May 2017 18:12:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=tlHMW9JmFa4MJw0x5sYORHa39ofKmNdEY0TMXc/S1W8=; b=Ysb5n+OGWIWbokB/ZsMYIfMouH +ajWtp9ixLioyymP9EA6S4lE06ATctM6iRV+CS2GvAR4hmnYxGQZpb5J3oq9j6+bAI9Ju4QZcoqRO 2yDL964z9d1sznQkHsfxFA5/iUDKa8ZtR7vuIBzYLDqwhXsAGLDjSxI76JAFalJPMgK7LwJk47jEm kQBysXTJcInOQEtTPeOkFbYv/LQGTJ/VWt4K+OumxaQ43JPnAtG22jF8qdSnB3PJNN9FetrKyxpW7 WhUp2iGFdosWI5iVl2ZRJH29SWGnJgtl1lfLHO7rfPfnJb6XA1Oot7ILrvlts9nylXfBWYClyjOmu RzoiYCWg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dDamG-0007U0-Rb; Wed, 24 May 2017 18:12:56 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dDaYU-0007bf-Fh for linux-arm-kernel@lists.infradead.org; Wed, 24 May 2017 17:58: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 D12F7165C; Wed, 24 May 2017 10:58:25 -0700 (PDT) Received: from e106794-lin.cambridge.arm.com (e106794-lin.cambridge.arm.com [10.1.210.58]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id A7C533F41F; Wed, 24 May 2017 10:58:22 -0700 (PDT) From: Jean-Philippe Brucker To: linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, iommu@lists.linux-foundation.org Subject: [PATCH 2/7] dt-bindings: PCI: Describe ATS property for root complex nodes Date: Wed, 24 May 2017 19:01:38 +0100 Message-Id: <20170524180143.19855-3-jean-philippe.brucker@arm.com> X-Mailer: git-send-email 2.12.1 In-Reply-To: <20170524180143.19855-1-jean-philippe.brucker@arm.com> References: <20170524180143.19855-1-jean-philippe.brucker@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170524_105842_640646_43DBF881 X-CRM114-Status: GOOD ( 11.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, lorenzo.pieralisi@arm.com, will.deacon@arm.com, joro@8bytes.org, thunder.leizhen@huawei.com, rjw@rjwysocki.net, okaya@codeaurora.org, robh+dt@kernel.org, hanjun.guo@linaro.org, sudeep.holla@arm.com, bhelgaas@google.com, tn@semihalf.com, sunil.kovvuri@gmail.com, robin.murphy@arm.com, lenb@kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Address Translation Service (ATS) is an extension to PCIe allowing endpoints to manage their own IOTLB, called Address Translation Cache (ATC). Instead of having every memory transaction processed by the IOMMU, the endpoint can first send an Address Translation Requests for an IOVA, obtain the corresponding Physical Address from the IOMMU and store it in its ATC. Subsequent transactions to this memory region can be performed on the PA, in which case they are marked 'translated' and (partially) bypass the IOMMU. Since the extension uses fields that were previously reserved in the PCIe Translation Layer Packet, it seems ill-advised to enabled it on a system that doesn't fully support ATS. To "old" root complexes that simply ignored the new AT field, an Address Translation Request will look exactly like a Memory Read Request, so the root bridge will forward a memory read to the IOMMU instead of a translation request. If the access succeeds, the RC will send a Read Completion, which looks like a Translation Completion, back to the endpoint. As a result the endpoint might end up storing the content of memory instead of a physical address in its ATC. In reality, it's more likely that the size fields will be invalid and either end will detect the error, but in any case, it is undesirable. Add a way for firmware to tell the OS that ATS is supported by the PCI root complex. Signed-off-by: Jean-Philippe Brucker --- Documentation/devicetree/bindings/pci/pci-iommu.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Documentation/devicetree/bindings/pci/pci-iommu.txt b/Documentation/devicetree/bindings/pci/pci-iommu.txt index 0def586fdcdf..f21a68ec471a 100644 --- a/Documentation/devicetree/bindings/pci/pci-iommu.txt +++ b/Documentation/devicetree/bindings/pci/pci-iommu.txt @@ -44,6 +44,14 @@ Optional properties - iommu-map-mask: A mask to be applied to each Requester ID prior to being mapped to an IOMMU specifier per the iommu-map property. +- ats-supported: if present, the root complex supports the Address + Translation Service (ATS). It is able to interpret the AT field in PCIe + Transaction Layer Packets, and forward Translation Completions or + Invalidation Requests to endpoints. + + Device drivers should not enable ATS in endpoints unless this property + is present. + Example (1) ===========