Received: by 10.192.165.148 with SMTP id m20csp4819814imm; Tue, 8 May 2018 15:12:18 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrWdmG3bzsJgGw8WaxqIfaCNrnVzJnmwif4o2En0u3ENFGlE/Lrp0oUgqLojhtvIG0amacp X-Received: by 2002:a17:902:2826:: with SMTP id e35-v6mr17605831plb.348.1525817538460; Tue, 08 May 2018 15:12:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525817538; cv=none; d=google.com; s=arc-20160816; b=HhbaQ0ZYP/90FvLlt0QbdC4C2AiXdGotrZd824BpnqbJCgpc7pqd31b6rRTkg39Xue bVpWZRgpi0z2qBrQC0XaNhF7wkddJui8K16wJwhH3BNcncb89P2vKF4ymTomP8aOCgP/ W+Y1mnHgZHC+stcZpsNJbDZ1Vi1g2rrvrkZEfoNj72dDjmKeZKFc052otpAR0n1X4Bvk WGp30JMzia8MNAMCovzj41D6sM+KHx6lXaDaQO+53/gNrHyrDq+hHpsyZYjcJ44E02mk qzYKANgZ7Ak35hUF/5cLuKB5glM0TcffB+sbKWcGeqPI7VrKjADzRtejGKnigqfEgT5u vEUA== 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=Hxardnzj1qnuMDE5yfhmtZbAA/c2aMb75FH2+U3J5pg=; b=j41OFoWVFkEo06EMq9KYwv6xOyjqOxrLJheoIWBxRfg7AH6KAb0jb0x5G0StRDhmkm tVM3GtLg+JCiQtfOY7NoFMWxWYQbND+rt9gHYRvXHn+9vdWv3nUxHLsX7AVAFcejACsg +2FQc9FGLXTsObFL8k0UE3RosUy3BjzS/FpcpNHZmyrUdGodGik/lH5bs3kdQTkAvAyh S66Lq5RB/6cVcsthPIMCcAkU+r/o58T5hKuRcgYTK3OTA3wF6kofWhgygXhlriAcyil6 fKoN3Dde82/6faXoakkZnmK9T9FjVvvWYRD9N/CTQ1cb2OjJ/nyXn+Bkyy/nvwIoIjSa GCZA== 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 e90si16174189pfb.355.2018.05.08.15.12.03; Tue, 08 May 2018 15:12:18 -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 S1755984AbeEHWKl (ORCPT + 99 others); Tue, 8 May 2018 18:10:41 -0400 Received: from ale.deltatee.com ([207.54.116.67]:33468 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755941AbeEHWKj (ORCPT ); Tue, 8 May 2018 18:10:39 -0400 Received: from guinness.priv.deltatee.com ([172.16.1.162]) by ale.deltatee.com with esmtp (Exim 4.89) (envelope-from ) id 1fGAoT-0000Pk-Ex; Tue, 08 May 2018 16:10:26 -0600 To: Alex Williamson , Stephen Bates Cc: =?UTF-8?Q?Christian_K=c3=b6nig?= , 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 , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Benjamin Herrenschmidt References: <20180423233046.21476-1-logang@deltatee.com> <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> <20180508144341.0441b676@w520.home> <20180508152631.50fd583c@w520.home> <354F7407-0DC7-470C-B9AA-74FDF9C46B08@raithlin.com> <20180508160336.0935ddde@w520.home> From: Logan Gunthorpe Message-ID: <20905682-9440-7d4b-0260-99d3dc794c3d@deltatee.com> Date: Tue, 8 May 2018 16:10:19 -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: <20180508160336.0935ddde@w520.home> 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, jglisse@redhat.com, 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, christian.koenig@amd.com, sbates@raithlin.com, alex.williamson@redhat.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 08/05/18 04:03 PM, Alex Williamson wrote: > If IOMMU grouping implies device assignment (because nobody else uses > it to the same extent as device assignment) then the build-time option > falls to pieces, we need a single kernel that can do both. I think we > need to get more clever about allowing the user to specify exactly at > which points in the topology they want to disable isolation. Thanks, Yeah, so based on the discussion I'm leaning toward just having a command line option that takes a list of BDFs and disables ACS for them. (Essentially as Dan has suggested.) This avoids the shotgun. Then, the pci_p2pdma_distance command needs to check that ACS is disabled for all bridges between the two devices. If this is not the case, it returns -1. Future work can check if the EP has ATS support, in which case it has to check for the ACS direct translated bit. A user then needs to either disable the IOMMU and/or add the command line option to disable ACS for the specific downstream ports in the PCI hierarchy. This means the IOMMU groups will be less granular but presumably the person adding the command line argument understands this. We may also want to do some work so that there's informative dmesgs on which BDFs need to be specified on the command line so it's not so difficult for the user to figure out. Logan