Received: by 10.213.65.68 with SMTP id h4csp1801663imn; Thu, 29 Mar 2018 11:17:21 -0700 (PDT) X-Google-Smtp-Source: AIpwx49rNAeQD/rTn1QKj0/Z4amo8ZyBd6/pmvUxcGGbC++6gg3oU2ErcGXkz7cqriUqr9qV5npo X-Received: by 10.99.0.136 with SMTP id 130mr6149019pga.368.1522347441010; Thu, 29 Mar 2018 11:17:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522347440; cv=none; d=google.com; s=arc-20160816; b=VJlWytc/T86mTHjKqjFtldWaYmrK09shFj9cMltgaAtJCRJ3TOfmY/qrntpn7FYn6P 8AAhtbuzYGZQb0uoOl5EgYe/EaGJfZGZ0QY8KoFpLg1Vef2xdWg0nuiP0sQgNm30EmmE tx2jkP0T/e4rQ6Rvq+P6senNQCCxuHiKFygQAGobUlfV6IUdu4Nb2v0XfNsktrQm6ylu hIOc6HiEp7N7f4DsrBZvlKP+9i/ksfmWvX83I7U3jYIfMEVc0McE50i2/pTAwaC8JioD 9W0EqZpqMcbJa4tvt7/42oblqV8D0R1APvt0zDt48yUB+AHnGTnmDg/W8YfY28uj1xxT 2Ihw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:arc-authentication-results; bh=rkTjB9DYrgpmoO/Ol8wqq4ukSE1EWmOH8TaTqeASkEE=; b=JLVAnlZeE6DLX0tdJHXEGrMrTQkvzVnY+4UqDEcAwLkNhNuMi7HdlX3kFAN6XpiYD8 loaI4eX84q5gdB8b3MO472xfffvc8PuHAYww0lyEQMpkn+QtDCTULnHEJalCqYwiz7Zp URwuQoFTcJC22vos5Cn4Spa9IzsXyoPDxakHeMFMHkhZ83OfaurXdHvdYEBeDoyMgCrv fcXwSo6rgJvQSiM3DhRBOyKl6QgwvbeHQ5abL7Apl4wkH3tK8VBSA7x4Gyd5bqoG8kOP qC8mhA5PoqR9htSRcHO9l7UQ5X5MOU3+3tgX+VqLNROwowQnFL7jUlGygpsbMqQb9/hF d0aA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=S45YFspb; 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 m189si4848749pfb.130.2018.03.29.11.17.07; Thu, 29 Mar 2018 11:17:20 -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=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=S45YFspb; 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 S1754139AbeC2SQE (ORCPT + 99 others); Thu, 29 Mar 2018 14:16:04 -0400 Received: from mail-bl2nam02on0073.outbound.protection.outlook.com ([104.47.38.73]:54982 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753544AbeC2SPr (ORCPT ); Thu, 29 Mar 2018 14:15:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=rkTjB9DYrgpmoO/Ol8wqq4ukSE1EWmOH8TaTqeASkEE=; b=S45YFspbVhZdjqURhT7f9YYboRXQT6OPIwrHtR9/KrjqLjSZc46ndTshYUi2Ng/QcTpS8TnRYQ4iPUYWoRkjMsTRybszYYc3EbxuJvJOYigvRbtthzH55HdTYughsaRCl4gn4GL+BLyQqmW3XqUBQ/rap6xD696wRHLjJ5eh/Us= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Christian.Koenig@amd.com; Received: from [IPv6:2a02:8109:500:e1c:9cb2:851a:ba0a:aaa3] (2a02:8109:500:e1c:9cb2:851a:ba0a:aaa3) by BN6PR12MB1716.namprd12.prod.outlook.com (10.175.101.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.631.10; Thu, 29 Mar 2018 18:15:43 +0000 Subject: Re: [PATCH 2/8] PCI: Add pci_find_common_upstream_dev() To: Logan Gunthorpe , 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, Bjorn Helgaas 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> <70adc2cc-f7aa-d4b9-7d7a-71f3ae99f16c@gmail.com> <98ce6cfd-bcf3-811e-a0f1-757b60da467a@deltatee.com> <8d050848-8970-b8c4-a657-429fefd31769@amd.com> From: =?UTF-8?Q?Christian_K=c3=b6nig?= Message-ID: Date: Thu, 29 Mar 2018 20:15:33 +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: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Originating-IP: [2a02:8109:500:e1c:9cb2:851a:ba0a:aaa3] X-ClientProxiedBy: AM5PR0102CA0033.eurprd01.prod.exchangelabs.com (10.167.167.46) To BN6PR12MB1716.namprd12.prod.outlook.com (10.175.101.13) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: ea038fa2-14f1-4528-ae30-08d595a11710 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:BN6PR12MB1716; X-Microsoft-Exchange-Diagnostics: 1;BN6PR12MB1716;3:4vNs9q2Vhj9OW3gnk3AU9+5NivDTfwQ4YisgsPGtTMbNQPYL5rifHtnSUJjz/oD2NdFqDzMzTvNGCrpxE2RFE3tXqLefpQwqgcHGQOKq+cm6SkLHNoXN5xzmnO2/kopZETPYty3YW8+mCvEDhK10i5X8S0L1srp052otZHUdqdjDe6HcmV+/Oogp28dlmBUi1w2NR7ishDdQ9Ahh5161QlatVBto66orSJktyM1Bul85XCHLD4RUN2ncLnNRr17d;25:1YM0YjMJ+3jveGUCyqZKTlvTiRGDEtv5Ev2Aw5e9sGRP9aMnyu71HSJUXVCy5YbHhgB7nVW4twtidpRh81i9HamDy30BUsrNDjElmFzee7BQVHYG54GEHCfbSCXu1q8NTD6dv/TAWHnU/9prfN1sTCSauyRc6t7K7MeFGnj4k3St6n/hbPYUqvHotdLowvCRxBeoHxJIUVRksC/l1yj+unIXG9TRdJ8GkV2o4A/5jDCoYAvhDOx65jUZnW+upCJ0mmWwzOH01Mz/gW/wszdIN6S5fzCydHrOxcruXWaurDdEgjKvx2kNXlRYuqsmU3DvrZ89PM+7JBqa0cHiu6lGaA==;31:/ZnDUW7kdRS7M5LZxtN4xmBj3F3rwPywjAGjanMK01kXF5At/RK5DY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-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(3231221)(944501327)(52105095)(93006095)(93001095)(10201501046)(6055026)(6041310)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:BN6PR12MB1716;BCL:0;PCL:0;RULEID:;SRVR:BN6PR12MB1716; X-Forefront-PRVS: 0626C21B10 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(346002)(396003)(366004)(376002)(39380400002)(39860400002)(189003)(199004)(110136005)(50466002)(5660300001)(478600001)(4326008)(65826007)(305945005)(25786009)(86362001)(97736004)(58126008)(105586002)(7736002)(2616005)(68736007)(72206003)(476003)(486005)(46003)(6116002)(53936002)(2906002)(1706002)(52396003)(52116002)(52146003)(65956001)(229853002)(23676004)(47776003)(2486003)(486005)(2870700001)(31696002)(76176011)(106356001)(31686004)(65806001)(67846002)(551934003)(386003)(81156014)(93886005)(11346002)(36756003)(8676002)(81166006)(6246003)(8936002)(6486002)(59450400001)(64126003)(53546011)(16526019)(186003)(446003)(6666003)(316002);DIR:OUT;SFP:1101;SCL:1;SRVR:BN6PR12MB1716;H:[IPv6:2a02:8109:500:e1c:9cb2:851a:ba0a:aaa3];FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTjZQUjEyTUIxNzE2OzIzOlA3MXoyeW1YMTU0K01tb0RvdFd6M0NjeXJp?= =?utf-8?B?c05sWkdMWVZ0NllEcmM0U2FINjNwd3EvaWUvNmFRWU15cVVIZEZ1S0lQcllS?= =?utf-8?B?VHFSMUVnZE5pbFh6bTNzWk1jT0c1dzFIMVVLWEtNVnZTSnI0UjVUNUVEUGNQ?= =?utf-8?B?WnpxUFlvMUZ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U21OUEk1?= =?utf-8?Q?cwwxA9?= X-Microsoft-Antispam-Message-Info: twGtDTCI0lS9844+aBNev8buf5TV45oRvNILTz1BnvMXW8yTewE3YkF5qbQhD2nKa7xHxbS0cp+M0k5Ip5VvDGL24vtcspI3YC30X6/WDxZAPm/z8IcX15oAVT9akwHZTxucjOZyj6soyKXCxw8YM5o6m4TcmUxUf1ce3RD7KsWBjg9bdqgHGn6/tcD/j3gY X-Microsoft-Exchange-Diagnostics: 1;BN6PR12MB1716;6:mJt8Vq1G8KO+ZL9hgTlgfBII5E6pbuOMAR0UHkq6tH8YVTSRoMbFmVUZA8kNmBjDGIwaCsON2qo5J3qqSx2iDlir7c9seZTNvs78pI8mhr7U38s91WDj3vLWQYR7dO3Z70qT/qw1+lNyl3K9jZRgR0+Mf1XloFLjexfuzx5Osc2SXrHYPpNlppJh8NSHUa4BnxonUA8MIZGe7Bi4jOnz9K/xQ+W8i/JPdXHjtKyKi7rwWS5m0+5vCXtFbov6n7kO4Turcrr7SVe4/DC486MequujmIt/b+LFNyslsbehhPQvup9ei2PJNzLprDE0v0LCHLhuge0P2jFEcnUMmNh9UZts87F6Bxuq3d4dMah8eMA1Xtbvytjz3I5JdwxODtAEYZ46dy4rzpyhA/uXe1lfd1S03b716ip+JUkQGA6aFYcAkm8Fp05MdaHn/iHH1qFy5dmZyyMcncYX52ogwMvgcw==;5:w2+uQxJi/5R4860tdag4WHAylm9ts0uAMG1CzfRa4hpqcQiic+T0GBCdD/WX5e95cK1574086ZJcNeTRj8tclM0qSJoX8EqwJbKltxjdc9Rxj9fr+zTOIr/8BMZiHgKnfoeMsAMIJ/A7NGGCMNfiNzxjwOgCtEIFcssp4FQHaZk=;24:8EyrCG1bHEaJHw/lf9TRA+xSHMMV4vxas7U2fxVswcmcFQYxPHPhxInSSkwuYrjeFfUHvyC8xnk+6cLsjyuWtvgPQiT7MNg2ZPfkUbsMsRs= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BN6PR12MB1716;7:8kXnWVTdnila7/K1KWBg6ip+VtN1TcbOFDMTOB0dGC0YJR5udjxxxf1T+yxVNCeFh8a4VzRsMPKSw8+NKV+4CKvzrnJrOBF1sYH5SwzBI/enxAD1AgC16DmbOdCWGK5jlpZOBs1m8QrVQfAu5+n1glgBZTH8u5lO8X0MZSmsufeWieSAhY5+Vxln3NRuEUHNxv5bYL6AYeILZ4QVr1ftW7HWGvNaVpI892IC2NLXt6DiwVfNwegjDiDff0Wo1VG0;20:Ki13Svdm6RjkR/jO2lEyh26NUuOG3ApVny0Jpg+DxS2lonTzZVwrVNQeQiQwNtcHMxlFbfTWHA4l33PnmOdsKL0Nxw/FcH5jMbOp80H3DHBJHq36jN15q5Vb6jndQvixiwVToTS07i5XnXPLKa+JF/8jNFPx+KtUNOeHmSSR/E/MDraVKYNzhJTljO3VXn92jn0CbIPmfWfsHWw6YX+5pCHPKY9QjJ0eXRca+qdeIRlN6VcfWT9Z6FVR4z7sTeiM X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Mar 2018 18:15:43.4521 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ea038fa2-14f1-4528-ae30-08d595a11710 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 29.03.2018 um 18:25 schrieb Logan Gunthorpe: > > On 29/03/18 10:10 AM, Christian König wrote: >> Why not? I mean the dma_map_resource() function is for P2P while other >> dma_map_* functions are only for system memory. > Oh, hmm, I wasn't aware dma_map_resource was exclusively for mapping > P2P. Though it's a bit odd seeing we've been working under the > assumption that PCI P2P is different as it has to translate the PCI bus > address. Where as P2P for devices on other buses is a big unknown. Yeah, completely agree. On my TODO list (but rather far down) is actually supporting P2P with USB devices. And no, I don't have the slightest idea how to do this at the moment. >>> And this is necessary to >>> check if the DMA ops in use support it or not. We can't have the >>> dma_map_X() functions do the wrong thing because they don't support it yet. >> Well that sounds like we should just return an error from >> dma_map_resources() when an architecture doesn't support P2P yet as Alex >> suggested. > Yes, well except in our patch-set we can't easily use > dma_map_resources() as we either have SGLs to deal with or we need to > create whole new interfaces to a number of subsystems. Agree as well. I was also in clear favor of extending the SGLs to have a flag for this instead of the dma_map_resource() interface, but for some reason that didn't made it into the kernel. >> You don't seem to understand the implications: The devices do have a >> common upstream bridge! In other words your code would currently claim >> that P2P is supported, but in practice it doesn't work. > Do they? They don't on any of the Intel machines I'm looking at. The > previous version of the patchset not only required a common upstream > bridge but two layers of upstream bridges on both devices which would > effectively limit transfers to PCIe switches only. But Bjorn did not > like this. At least to me that sounds like a good idea, it would at least disable (the incorrect) auto detection of P2P for such devices. >> You need to include both drivers which participate in the P2P >> transaction to make sure that both supports this and give them >> opportunity to chicken out and in the case of AMD APUs even redirect the >> request to another location (e.g. participate in the DMA translation). > I don't think it's the drivers responsibility to reject P2P . The > topology is what governs support or not. The discussions we had with > Bjorn settled on if the devices are all behind the same bridge they can > communicate with each other. This is essentially guaranteed by the PCI spec. Well it is not only rejecting P2P, see the devices I need to worry about are essentially part of the CPU. Their resources looks like a PCI BAR to the BIOS and OS, but are actually backed by stolen system memory. So as crazy as it sounds what you get is an operation which starts as P2P, but then the GPU drivers sees it and says: Hey please don't write that to my PCIe BAR, but rather system memory location X. >> DMA-buf fortunately seems to handle all this already, that's why we >> choose it as base for our implementation. > Well, unfortunately DMA-buf doesn't help for the drivers we are working > with as neither the block layer nor the RDMA subsystem have any > interfaces for it. A fact that gives me quite some sleepless nights as well. I think we sooner or later need to extend those interfaces to work with DMA-bufs as well. I will try to give your patch set a review when I'm back from vacation and rebase my DMA-buf work on top of that. Regards, Christian. > > Logan