Received: by 10.213.65.68 with SMTP id h4csp1429606imn; Thu, 29 Mar 2018 04:46:16 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/Hk8RdQEPVT6CNj5RmwOJKG6Mn7MlhrHWzkae1+tvYrkudzL3YHPay5iBrj30dSr7K+fjz X-Received: by 10.99.190.5 with SMTP id l5mr5363771pgf.25.1522323976048; Thu, 29 Mar 2018 04:46:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522323976; cv=none; d=google.com; s=arc-20160816; b=RjEZr5Di2RFs8yusJmMPspoyXdPt+jOORFvqNJC3AKirRwGkIn+fbCqMq1+xOo87yI M8itimIZpbYUeujXPWmxDQg2Y+32itldkFcUpCT/Yc1CFMkKzzEOfdyWW3Tc41mtztoV CUWAPetlDYOS+sysH8bPrB4n8mOKWsPO/oLOCYb98M36cY4EXhLe4XNxQW/ch81u6eQt x1zb2FL1y+fgytLocoxLvPFOFG87nvpRdWxRYsv5u9gP1ZKtSgS5tQ29MzfqDvizpEil J0rB3c+9hQKMOrNYR7xK0IEqugAGM4PK7sJuFBXKrY21VwbGr0epSyjyXHy8BJ/8bpmW c+dA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:reply-to:dkim-signature :arc-authentication-results; bh=ccOrT5e960S62D1KZbg5c4P5RO2gGtthZxVM1LyDceY=; b=PXb+k9VBJDFmQQ5C9UicH3uCfULCqDQ5WRUikLVYkR7IUyvVtE8rANFVQxBabm+GIA zADHKTNuS00jWkk8F6lenqIwnG+UeZBMT69SYhmpMvhw3CIOpOEdc48K/j/QCamOFyy1 Ym4cyBBil+mKx7aZxmbKD6EI332MR1cGwseQf88FNvmx26Yz6u4tPqx4VeyqUMThSV8o Y8NNFdrh5pivIIhjKxip6cfaXRDrYkLgdlmFBvLuMdAMuFg6+ue3wekQBwNRmvu0mb/W 0NF8JGJggfR0WMqNom7LeXz95x333pTxh9NNZBC21et8zrJ9qja1KJHNrg06qiErQZom mGhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=evOQapTJ; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3-v6si5741327plz.179.2018.03.29.04.46.01; Thu, 29 Mar 2018 04:46:16 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=evOQapTJ; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752973AbeC2LpI (ORCPT + 99 others); Thu, 29 Mar 2018 07:45:08 -0400 Received: from mail-wr0-f178.google.com ([209.85.128.178]:44407 "EHLO mail-wr0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752865AbeC2LpC (ORCPT ); Thu, 29 Mar 2018 07:45:02 -0400 Received: by mail-wr0-f178.google.com with SMTP id u46so5108529wrc.11; Thu, 29 Mar 2018 04:45:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=reply-to:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=ccOrT5e960S62D1KZbg5c4P5RO2gGtthZxVM1LyDceY=; b=evOQapTJ2CDOCfTo07ts3VpSYpsgSQXfrv5IbNGy65yOmQ1j5uGkkl0ZSm74FngcFh 9mwUMfuuX00Y/rA8ziG6lx+mgxysLA4SqLXRD+24tdEhpWkS1TvaN9AKydWjr66ZSyoz HIUVwxCyhuJh2Z9CLlGQ9Z35GMm7Ldmr1sZm+QMF1K6hUBDZOL9ZVlWH0fbAgcbdMAix 1mOT1dUAZYj4hBgt8LuJe+IuAaMjYC78qPtnRIGHKFbl8mIK2c3BegEv42fZYxQVmi5P EZHPl7cQaYtGUcjrmmNMOUWL+woYQ2gvfUNtODpK9Ear2drFqoqAPklwDY7lsvPGhV+H porw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:reply-to:subject:to:cc:references:from :message-id:date:user-agent:mime-version:in-reply-to :content-transfer-encoding:content-language; bh=ccOrT5e960S62D1KZbg5c4P5RO2gGtthZxVM1LyDceY=; b=aEUPv4B6EfLgKI1wsTOruDvD0r2v88whHY2vvgDWLX8QoGMUH6xw1y/pU5Yi0ICqdR 4V+CXQsARhEGah37bUfpZQMJTOAoq7KTW45k1rrTKmnNYijDTsVj9FHGcAE/Cxplss13 06Cu+pfQzylzKCoP3Rg+16HCJhfFlg2+k6cebVUrwrs7SiRZ3PVHdV3J/mJLtWKmFZ71 b3IqHxk8vSzaHJlPXTGIUk6vu4SzdiIbJ7LaagDYdKmeT5PGvg/gUk3kaWo8OvbxyYPN EZrybQhoet+IpLF4DuII9s3hvQyFvxTevk3k/n3ZSMZC+O3/aWbbEY/6v2/1AvjSafbb Y4AQ== X-Gm-Message-State: AElRT7F1WFEapWjEg9DOi63I2Kv9vorUrJaDoP/Os3ldoQdusBOwiQUS o74ksWSC8wARsre6BaiW4Gayl4mO X-Received: by 10.223.143.86 with SMTP id p80mr6678727wrb.31.1522323900901; Thu, 29 Mar 2018 04:45:00 -0700 (PDT) Received: from ?IPv6:2a02:8109:500:e1c:8d9f:809a:df07:714b? ([2a02:8109:500:e1c:8d9f:809a:df07:714b]) by smtp.gmail.com with ESMTPSA id m18sm5331241wri.65.2018.03.29.04.44.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Mar 2018 04:45:00 -0700 (PDT) Reply-To: christian.koenig@amd.com Subject: Re: [PATCH 2/8] PCI: Add pci_find_common_upstream_dev() To: Logan Gunthorpe , =?UTF-8?Q?Christian_K=c3=b6nig?= , Christoph Hellwig Cc: 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 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> <73578b4e-664b-141c-3e1f-e1fae1e4db07@amd.com> <1b08c13e-b4a2-08f2-6194-93e6c21b7965@deltatee.com> From: =?UTF-8?Q?Christian_K=c3=b6nig?= Message-ID: <70adc2cc-f7aa-d4b9-7d7a-71f3ae99f16c@gmail.com> Date: Thu, 29 Mar 2018 13:44:59 +0200 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: <1b08c13e-b4a2-08f2-6194-93e6c21b7965@deltatee.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 28.03.2018 um 21:53 schrieb Logan Gunthorpe: > > On 28/03/18 01:44 PM, Christian König wrote: >> Well, isn't that exactly what dma_map_resource() is good for? As far as >> I can see it makes sure IOMMU is aware of the access route and >> translates a CPU address into a PCI Bus address. >> I'm using that with the AMD IOMMU driver and at least there it works >> perfectly fine. > Yes, it would be nice, but no arch has implemented this yet. We are just > lucky in the x86 case because that arch is simple and doesn't need to do > anything for P2P (partially due to the Bus and CPU addresses being the > same). But in the general case, you can't rely on it. Well, that an arch hasn't implemented it doesn't mean that we don't have the right interface to do it. >>>> 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. >> Sorry to say that, but I know a whole bunch of PCI devices which >> horrible ignores that. > Can you elaborate? As far as the device is concerned it shouldn't know > whether a request comes from a peer or from the host. If it does do > crazy stuff like that it's well out of spec. It's up to the switch (or > root complex if good support exists) to route the request to the device > and it's the root complex that tends to be what drops the load requests > which causes the asymmetries. Devices integrated in the CPU usually only "claim" to be PCIe devices. In reality their memory request path go directly through the integrated north bridge. The reason for this is simple better throughput/latency. That is hidden from the software, for example the BIOS just allocates address space for the BARs as if it's a normal PCIe device. The only crux is when you then do peer2peer your request simply go into nirvana and are not handled by anything because the BARs are only visible from the CPU side of the northbridge. Regards, Christian. > > Logan > _______________________________________________ > amd-gfx mailing list > amd-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/amd-gfx