Received: by 10.213.65.68 with SMTP id h4csp747527imn; Wed, 28 Mar 2018 11:59:36 -0700 (PDT) X-Google-Smtp-Source: AIpwx481hrlZNPtH2pgdxyWUOGr6cXp3srmI6y9fP8PdgaCYoJMTZofbPV/Ib1YAhNhIc04iKwJz X-Received: by 10.167.131.135 with SMTP id u7mr3901805pfm.50.1522263576473; Wed, 28 Mar 2018 11:59:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522263576; cv=none; d=google.com; s=arc-20160816; b=Ylsfkiebj+oaKbiTa8Wzvchxmi6kJHNViWHORjv/FwjSbZvkF+F3CGL7D83UI8khMM I4k34AqTbeIK6xy555Dy9fOyZeYCsbssioVPotWV080PaGd87s/TOj3/l2IKTNG3/uuk iMB96xTBf2PDGn28aQKL4p+RKjtZ4IzE6j3nR/gjkSK4wYeWnQzdcCL+y/EXhNWq7wK3 kFH/jKmUaEY1Z4vl2gMFxWOpPs1wuihOmcGlUeV4lGWLQ8ebazCbQrPHrAKhk3JrAb5X SrLNepI9G3dIpaF8NhA+KamNVXZ4VTs8YTru5E8YDX6T0N0+Ir4K5iQIROQwiLisX9Q+ 35Mg== 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=3ODy1hkD58HkH/YW4/PLMxkUyWlBbBIZgF7n3eC1xM0=; b=RNaBYJegjIX5Z6dmpuZAe49cA4L4NmaAdMmhl9Dqf8sJz56ImhY8+o11BNg9egDgvZ W4ZvG27+DtJHpfQq3fNWUMajV+D5F8+Xp7/7dHEibixhZkuw3LOQvqFuCdGqX9IbJ4fu mgM90lOapMRMil3TIyt0/yKIz/4k5YiEFz+kf2ocePVMq+8TmfPqtKI4fvTgVkfJuRTe xRPh9sGAgQOpZMkQ1XTkmYGQQkVyRfYE2p42SQkQZHgzsAUMcTVwLL/jOkubueOgZ994 1vATmlg9ipHMJJGGzZTkWsQu+amBJJ1ESLZaUNLvC13VMZdMqd3T05dgGdJ0cRv2kEF4 e9Cw== 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 j15si2913530pga.418.2018.03.28.11.59.21; Wed, 28 Mar 2018 11:59:36 -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 S1753336AbeC1S6E (ORCPT + 99 others); Wed, 28 Mar 2018 14:58:04 -0400 Received: from ale.deltatee.com ([207.54.116.67]:40616 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753117AbeC1S6C (ORCPT ); Wed, 28 Mar 2018 14:58:02 -0400 Received: from guinness.priv.deltatee.com ([172.16.1.162]) by ale.deltatee.com with esmtp (Exim 4.89) (envelope-from ) id 1f1GGm-0000Aw-Jc; Wed, 28 Mar 2018 12:58:01 -0600 To: =?UTF-8?Q?Christian_K=c3=b6nig?= , Christoph Hellwig Cc: linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org References: <20180325110000.2238-1-christian.koenig@amd.com> <20180325110000.2238-2-christian.koenig@amd.com> <20180328123830.GB25060@infradead.org> <613a6c91-7e72-5589-77e6-587ec973d553@gmail.com> <5498e9b5-8fe5-8999-a44e-f7dc483bc9ce@amd.com> <16c7bef8-5f03-9e89-1f50-b62fb139a36f@deltatee.com> <6a5c9a10-50fe-b03d-dfc1-791d62d79f8e@amd.com> From: Logan Gunthorpe Message-ID: Date: Wed, 28 Mar 2018 12:57:57 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <6a5c9a10-50fe-b03d-dfc1-791d62d79f8e@amd.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 172.16.1.162 X-SA-Exim-Rcpt-To: linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, linaro-mm-sig@lists.linaro.org, hch@infradead.org, christian.koenig@amd.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,T_RP_MATCHES_RCVD autolearn=ham autolearn_force=no version=3.4.1 Subject: Re: [PATCH 2/8] PCI: Add pci_find_common_upstream_dev() 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 28/03/18 12:28 PM, Christian König wrote: > I'm just using amdgpu as blueprint because I'm the co-maintainer of it > and know it mostly inside out. Ah, I see. > The resource addresses are translated using dma_map_resource(). As far > as I know that should be sufficient to offload all the architecture > specific stuff to the DMA subsystem. It's not. The dma_map infrastructure currently has no concept of peer-to-peer mappings and is designed for system memory only. No architecture I'm aware of will translate PCI CPU addresses into PCI Bus addresses which is necessary for any transfer that doesn't go through the root complex (though on arches like x86 the CPU and Bus address happen to be the same). There's a lot of people that would like to see this change but it's likely going to be a long road before it does. Furthermore, one of the reasons our patch-set avoids going through the root complex at all is that IOMMU drivers will need to be made aware that it is operating on P2P memory and do arch-specific things accordingly. There will also need to be flags that indicate whether a given IOMMU driver supports this. None of this work is done or easy. > Yeah, but not for ours. See if you want to do real peer 2 peer you need > to keep both the operation as well as the direction into account. Not sure what you are saying here... I'm pretty sure we are doing "real" peer 2 peer... > For example when you can do writes between A and B that doesn't mean > that writes between B and A work. And reads are generally less likely to > work than writes. etc... If both devices are behind a switch then the PCI spec guarantees that A can both read and write B and vice versa. Only once you involve root complexes do you have this problem. Ie. you have unknown support which may be no support, or partial support (stores but not loads); or sometimes bad performance; or a combination of both... and you need some way to figure out all this mess and that is hard. Whoever tries to implement a white list will have to sort all this out. Logan