Received: by 10.213.65.68 with SMTP id h4csp2732342imn; Mon, 2 Apr 2018 12:59:42 -0700 (PDT) X-Google-Smtp-Source: AIpwx49QrADphKJOlSYe77bO+47yJHbQ2ioVdUw3xprUzqeaY6QLnvmASWR+Q2daZXdOc8dxK42r X-Received: by 2002:a17:902:983:: with SMTP id 3-v6mr11323525pln.278.1522699182401; Mon, 02 Apr 2018 12:59:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522699182; cv=none; d=google.com; s=arc-20160816; b=I2o+SWLTkeUI21rg4Exi7X3LAwSRZztXK8zslqsfihiIA7EnkfXdvGmcoG1JldDSIs CiWNKqMWJ1dxlcCBa6xt2d9v8Tc0WOxtyncOZot2lFxh5WJIRXK+zxnFEx8tLrPcam4q fytcR9FjNEzYbwhSXEENrndoGVE3YaMwCdNZvgb+AobsDenGzcudbK/NlsZBim6YAvU3 1w9fEVkG7JcGXZej/3kmbxkRa0WIOXsdugOE1Yq0IpEJF3dmU1ZAZ0gIXlDPoKdLORmS 1Jqh96OVtVx+idALqqykCOZT8iWe7mnn9WXjQlqQAkkoOcGo6XEjCG80Wo5b+MT8xWh+ Wgkw== 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=eg+ITlwg1sOip1oftFeKm8Lw0xkZXy6sjJ150zGehBA=; b=W4IbZAt1k2EY/dqM6D76xgg8F3+HpeYpp42H3u8cZLsD7h6jdZelqsSC5HmyZ0Brul 2kPEySMWZX9zsxhjKVtw8nwEzoBxWHA7SClwrVuSAP4BUPEL18aDHdZgpU37Ho2UB54Z RW1DuvBQ5e3tMz/Yw3sxUFR/iRDnJhtfd5+JbK8RixGFZ7YTvZlP7vbYic3+I7c3fbq+ CE7sI/LYZiUY9OtxJiUFZ2x/aMLTYfrzXDW7Lcr5/p++kzlUmCL+gTOknC08Rw7nHR/t ydr5KGV7NPZIhzZ2EcQG1zPZpbSqhbG8xlupq8BXNcbSVWu6zLVl5ctZu0OYRoMOzgJS OrSA== 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 q4si647979pgv.822.2018.04.02.12.59.28; Mon, 02 Apr 2018 12:59:42 -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 S1757033AbeDBTcm (ORCPT + 99 others); Mon, 2 Apr 2018 15:32:42 -0400 Received: from ale.deltatee.com ([207.54.116.67]:41250 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757020AbeDBTck (ORCPT ); Mon, 2 Apr 2018 15:32:40 -0400 Received: from guinness.priv.deltatee.com ([172.16.1.162]) by ale.deltatee.com with esmtp (Exim 4.89) (envelope-from ) id 1f35C3-0006kW-1w; Mon, 02 Apr 2018 13:32:39 -0600 To: Jerome Glisse Cc: =?UTF-8?Q?Christian_K=c3=b6nig?= , Christoph Hellwig , Will Davis , Joerg Roedel , linaro-mm-sig@lists.linaro.org, amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, Bjorn Helgaas References: <70adc2cc-f7aa-d4b9-7d7a-71f3ae99f16c@gmail.com> <98ce6cfd-bcf3-811e-a0f1-757b60da467a@deltatee.com> <8d050848-8970-b8c4-a657-429fefd31769@amd.com> <20180330015854.GA3572@redhat.com> <0234bc5e-495e-0f68-fb0a-debb17a35761@deltatee.com> <20180330194519.GC3198@redhat.com> <31266710-f6bb-99ee-c73d-6e58afe5c38c@deltatee.com> <20180402172027.GA18231@redhat.com> <6f796779-0ba3-d056-de33-341ee55d6b38@deltatee.com> <20180402191649.GB18231@redhat.com> From: Logan Gunthorpe Message-ID: <4c672c71-6202-0775-7825-37f8077d1d35@deltatee.com> Date: Mon, 2 Apr 2018 13:32:37 -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: <20180402191649.GB18231@redhat.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: bhelgaas@google.com, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, joro@8bytes.org, wdavis@nvidia.com, hch@infradead.org, christian.koenig@amd.com, jglisse@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,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 02/04/18 01:16 PM, Jerome Glisse wrote: > There isn't good API at the moment AFAIK, closest thing would either be > lookup_resource() or region_intersects(), but a more appropriate one can > easily be added, code to walk down the tree is readily available. More- > over this can be optimize like vma lookup are, even more as resource are > seldomly added so read side (finding a resource) can be heavily favor > over write side (adding|registering a new resource). So someone needs to create a highly optimized tree that registers all physical address on the system and maps them to devices? That seems a long way from being realized. I'd hardly characterize that as "easily". If we can pass both devices to the API I'd suspect it would be preferred over the complicated tree. This, of course, depends on what users of the API need. > cache coherency protocol (bit further than PCIE snoop). But also the > other direction the CPU access to device memory can also be cache coherent, > which is not the case in PCIE. I was not aware that CAPI allows PCI device memory to be cache coherent. That sounds like it would be very tricky... > Note that with mmu_notifier there isn't any need to pin stuff (even > without any special hardware capabilities), as long as you can preempt > what is happening on your hardware to update its page table. I've been told there's a lot of dislike of the mmu_notifier interface. And being able to preempt what's happening on hardware, generally, is not trivial. But, yes, this is essentially how ODP works. Logan