Received: by 10.192.165.148 with SMTP id m20csp1413952imm; Thu, 10 May 2018 10:16:40 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqd0rMZlYAXfufkadEXXCuLyhUZaoTJXgmLZaDfKLboALTr17h5BEQcZIgMr7gxGIagz0W8 X-Received: by 2002:a62:7f91:: with SMTP id a139-v6mr2166673pfd.25.1525972600697; Thu, 10 May 2018 10:16:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525972600; cv=none; d=google.com; s=arc-20160816; b=N/0zaKpTzFZWmQJJvbzcjxUd2z5vvLWbCzcrVcx8mb817acjSusbnJ7E/UcJwFbm9o dP8Ayma+JUYUrz0sB7l4fzjDjRB55Lz2MdjAlYNlqHQG0K8mqoMeRJJYmDDQLwxpIebw yjeF3cvN2neCSYR/2QC6Ujc33OepncQI/l4EO+7D7UQHUAqujtgcUtOPtUG6n0kCsv8Z HxCsMKqK6+aHzeawP3m8DAXpCQHifKIvFvSd+n1kQ3kZALarva0LQog1G/Z4/8Jw0wgl S6LQCtevvU2UZe+eJ+/SFUM+wmQTudx+G///xVhoe+gCiBTm+eUJPpKw6zuJFAzlRe8k 5F0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:arc-authentication-results; bh=/WMP8cpWXmo6kDguJsk0ziwa9m2h6QUVyQIArW3auag=; b=0obUvKo3+xvFOD1dmRc7BhDCeGmj/dl5uu5uvgUUpdBQNuU1Cvkm7o2XxOExb1uM6s xNznMxab/Y55J7/GFOxP7g9YcmVu2z/dzKg69lFkjV2zXbDy36BhAMJhHIaROxwyNEo8 m27uGkLqd4YWUtDOPRVaRygAvusBWXY/LTae/tFhhHQGlqsgRg/SYNIpMOUd+/UpYh5i cYETvwXvLd216QjEKfeYUpib69JZUb8Y7WFfPoYGZ3zP16CfKmc2iw4QmBDFhkaSE2yF PcKAKxQC5Ff8AXrdhMfG8k/8KNInx0knks5KcJd0bcOv0ov8jelG2glbpYE5nlxaF+BC LA0g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v123-v6si1215964pfc.273.2018.05.10.10.16.26; Thu, 10 May 2018 10:16:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966676AbeEJRQN (ORCPT + 99 others); Thu, 10 May 2018 13:16:13 -0400 Received: from ale.deltatee.com ([207.54.116.67]:48260 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965017AbeEJRQL (ORCPT ); Thu, 10 May 2018 13:16:11 -0400 Received: from guinness.priv.deltatee.com ([172.16.1.162]) by ale.deltatee.com with esmtp (Exim 4.89) (envelope-from ) id 1fGpAV-0006Y7-E3; Thu, 10 May 2018 11:15:52 -0600 To: Stephen Bates , =?UTF-8?Q?Christian_K=c3=b6nig?= , Jerome Glisse Cc: Alex Williamson , Bjorn Helgaas , "linux-kernel@vger.kernel.org" , "linux-pci@vger.kernel.org" , "linux-nvme@lists.infradead.org" , "linux-rdma@vger.kernel.org" , "linux-nvdimm@lists.01.org" , "linux-block@vger.kernel.org" , Christoph Hellwig , Jens Axboe , Keith Busch , Sagi Grimberg , Bjorn Helgaas , Jason Gunthorpe , Max Gurtovoy , Dan Williams , Benjamin Herrenschmidt References: <20180423233046.21476-5-logang@deltatee.com> <20180507231306.GG161390@bhelgaas-glaptop.roam.corp.google.com> <0b4183ef-e720-204b-9e85-b9eaf7a4136a@deltatee.com> <3584a6ac-95c7-5d23-1859-aee30605776e@deltatee.com> <20180508133407.57a46902@w520.home> <5fc9b1c1-9208-06cc-0ec5-1f54c2520494@deltatee.com> <20180508141331.7cd737cb@w520.home> <20180508205005.GC15608@redhat.com> <7FFB9603-DF9F-4441-82E9-46037CB6C0DE@raithlin.com> <4e0d0b96-ab02-2662-adf3-fa956efd294c@deltatee.com> <2fc61d29-9eb4-d168-a3e5-955c36e5d821@amd.com> <94C8FE12-7FC3-48BD-9DCA-E6A427E71810@raithlin.com> <868B49CE-4F0E-4A48-BE78-12149F85F1A4@raithlin.com> From: Logan Gunthorpe Message-ID: <8113cba8-62b9-1801-7a77-f82be223b183@deltatee.com> Date: Thu, 10 May 2018 11:15:44 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <868B49CE-4F0E-4A48-BE78-12149F85F1A4@raithlin.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 172.16.1.162 X-SA-Exim-Rcpt-To: benh@kernel.crashing.org, dan.j.williams@intel.com, maxg@mellanox.com, jgg@mellanox.com, bhelgaas@google.com, sagi@grimberg.me, keith.busch@intel.com, axboe@kernel.dk, hch@lst.de, linux-block@vger.kernel.org, linux-nvdimm@lists.01.org, linux-rdma@vger.kernel.org, linux-nvme@lists.infradead.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, helgaas@kernel.org, alex.williamson@redhat.com, jglisse@redhat.com, christian.koenig@amd.com, sbates@raithlin.com X-SA-Exim-Mail-From: logang@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-8.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, GREYLIST_ISWHITE autolearn=ham autolearn_force=no version=3.4.1 Subject: Re: [PATCH v4 04/14] PCI/P2PDMA: Clear ACS P2P flags for all devices behind switches X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/05/18 11:11 AM, Stephen Bates wrote: >> Not to me. In the p2pdma code we specifically program DMA engines with >> the PCI bus address. > > Ah yes of course. Brain fart on my part. We are not programming the P2PDMA initiator with an IOVA but with the PCI bus address... > >> So regardless of whether we are using the IOMMU or >> not, the packets will be forwarded directly to the peer. If the ACS >> Redir bits are on they will be forced back to the RC by the switch and >> the transaction will fail. If we clear the ACS bits, the TLPs will go >> where we want and everything will work (but we lose the isolation of ACS). > > Agreed. > >> For EPs that support ATS, we should (but don't necessarily have to) >> program them with the IOVA address so they can go through the >> translation process which will allow P2P without disabling the ACS Redir >> bits -- provided the ACS direct translation bit is set. (And btw, if it >> is, then we lose the benefit of ACS protecting against malicious EPs). >> But, per above, the ATS transaction should involve only the IOVA address >> so the ACS bits not being set should not break ATS. > > Well we would still have to clear some ACS bits but now we can clear only for translated addresses. We don't have to clear the ACS Redir bits as we did in the first case. We just have to make sure the ACS Direct Translated bit is set. Logan