Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964787AbcKXJpm (ORCPT ); Thu, 24 Nov 2016 04:45:42 -0500 Received: from mail-co1nam03on0048.outbound.protection.outlook.com ([104.47.40.48]:41967 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934194AbcKXJpj (ORCPT ); Thu, 24 Nov 2016 04:45:39 -0500 X-Greylist: delayed 87634 seconds by postgrey-1.27 at vger.kernel.org; Thu, 24 Nov 2016 04:45:38 EST Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Christian.Koenig@amd.com; Subject: Re: Enabling peer to peer device transactions for PCIe devices To: Jason Gunthorpe , Dan Williams References: <75a1f44f-c495-7d1e-7e1c-17e89555edba@amd.com> <45c6e878-bece-7987-aee7-0e940044158c@deltatee.com> <20161123190515.GA12146@obsidianresearch.com> <7bc38037-b6ab-943f-59db-6280e16901ab@amd.com> <20161123193228.GC12146@obsidianresearch.com> <20161123203332.GA15062@obsidianresearch.com> <20161123215510.GA16311@obsidianresearch.com> <20161123232503.GA13965@obsidianresearch.com> CC: Logan Gunthorpe , Serguei Sagalovitch , "Deucher, Alexander" , "linux-nvdimm@lists.01.org" , "linux-rdma@vger.kernel.org" , "linux-pci@vger.kernel.org" , "Kuehling, Felix" , "Bridgman, John" , "linux-kernel@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , "Sander, Ben" , "Suthikulpanit, Suravee" , "Blinzer, Paul" , "Linux-media@vger.kernel.org" , Haggai Eran From: =?UTF-8?Q?Christian_K=c3=b6nig?= Message-ID: Date: Thu, 24 Nov 2016 10:45:18 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20161123232503.GA13965@obsidianresearch.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [2a02:908:1251:7981:a194:99a7:5754:f487] X-ClientProxiedBy: HE1PR03CA0020.eurprd03.prod.outlook.com (10.163.170.158) To DM5PR12MB1306.namprd12.prod.outlook.com (10.168.237.149) X-Microsoft-Exchange-Diagnostics: 1;DM5PR12MB1306;2:Yf+siEGj/jvnnkLg7dB6cH6Intl9B39lQ9ZaSA9muEjrzKtALgrRNWTe0xMzLSquvNOLIWjcE6ifrMRfW5q+4vS9tizbiUR0efx7Xi3MF2icr9K8xO0b4nj7+FrhJEvcPM7E4r7jw/xrCcrIt4nur5quzajl2TKbZQLZlanrfgE=;3:bf1GFyr3yxH7ntNZja2la8Hyccu97E09EeM821YLe67kiSOZ3AQEdy1xwvQVIQPb1rR+3RYweGrq8PsKbOQ3t6jBFhH+Lfdwf92jOPgLf/OfQm5jUweMTtao9sGU6/4mkIbXNKruGYWRc/Day5z2edevnJASY4bmG3nj0bsfZ2Q= X-MS-Office365-Filtering-Correlation-Id: 18f51999-dd32-48b5-72aa-08d4144ea487 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:DM5PR12MB1306; X-Microsoft-Exchange-Diagnostics: 1;DM5PR12MB1306;25:/9tTyOv70/gX+L4e6intCw4cFuWnuAXtDllpxLiGdhNzklDzJ1UnBQI9hf0IwcWe10o839nao8VJHsD1zsN5ysRpI0I7yiYZfeYdOU6GZASFDcDcqJhsfq6dI+TYa5uZsrTm9S4GMRWW4IVdOBbYpcIHsnPyv8L/j3qDDBsgPZGxoeF5bXzrZdlOSDs+74irBSqU4j9l1dLqnbrqSCdTYngOgKHLqUcNHRFhKlqkc0LRVMAxcNNRpIJR+q2rRfuccsfZmJ+a4owwnQ6nXEwrsPpCOtK2aj0LdrcSGFOtoYofTHM1QblT3UV4EHkSVrP7YbrsDpM3W0LSDiNQWvNSk3HLLu/xSoGkTmVfk9vXknXyPcPYZKyiP0Il/qxg9JCjvvgctblrPxGGufOgr6TU1zVKGXqlaeehSWXdImBLkViow20NPVVBTJ7Z/MLqjo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waY+I1jC28KjhDKCMulHBYhUQmviHz/KRTy5LDwV1tqEvk614optesvswYoT8zZaqQcoGZeSbZNrLpPOWEqPkm2Z4CVtR1tkWawxdiVOAdHupcRR05E7vz+HoKJ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6045199)(6060326)(6040361)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6061324)(6041248)(20161123555025)(20161123564025)(20161123560025)(20161123562025);SRVR:DM5PR12MB1306;BCL:0;PCL:0;RULEID:;SRVR:DM5PR12MB1306; X-Microsoft-Exchange-Diagnostics: 1;DM5PR12MB1306;4:hzTw2i2Gd0igPU9rHRFdivIQ61RUg4V/hr1YZrUxXNTrrUxJ9oZ7RkoX3aaFTSIiTMdKnLDVUvuCVZ1PVh/JSilzp/pGPcCsEdu6dvIeS847pFmg2I5WjUFTxegBpaaHF1Pn12/edmL0LFNQAz2CmUod4AecyfwcAL1NcK5TF8MOTFIhA+7GjkhbcR8RGGh8hKFg2bYFZwroYwx0hxbCPsoD1NH/x6lRpEfLVcx08HCePMKWMS4q/B/yT0yg1/kkYlJGOrKuldgdhnLdqhIYVmHfXkTO3N6OZtZsGs4XAeqLekBSjlPtOGtKHGHTEo5FuXaGZafOtoZgtJqL0Wo8jVmYhpl78vylakN2oiOGsvRf+4oC5Y/UzmDsFDJzj+sh31rlv0Uriziw3w/3pd57PBBkhccwUpEd09PGYe1JwWxM1UahSgafoB5P+FNQodozeiR9NKUt+d/T0deFB9KkfV287C1ZH1NoyCo5C8Q5RCpjjlIYbcZwwnaao1xI0kFdk5CNP4omhggWO2I/KvHUqG618EhMuJyzskCLmMJ0CW/DyBBxxmL2EHLDnRYjzCCBOGsQopreOFByNI7j5hKcHawm2Umegryhfuxvhyc7DXIcqPmbHknry5azl2nxo2dY X-Forefront-PRVS: 0136C1DDA4 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(7916002)(189002)(199003)(81156014)(64126003)(2950100002)(86362001)(6666003)(189998001)(7416002)(76176999)(81166006)(65826007)(50986999)(5660300001)(42186005)(23746002)(31696002)(50466002)(36756003)(39380400001)(39400400001)(92566002)(31686004)(54356999)(5001770100001)(101416001)(77096005)(2906002)(305945005)(230700001)(83506001)(47776003)(97736004)(39410400001)(38730400001)(65806001)(65956001)(4326007)(8676002)(93886004)(229853002)(68736007)(33646002)(106356001)(7736002)(7846002)(6116002)(105586002)(4001350100001)(1706002);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR12MB1306;H:[IPv6:2a02:908:1251:7981:a194:99a7:5754:f487];FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;DM5PR12MB1306;23:VhtMAIv1kYJawaUrC7/b/bo8R/9LfmaxM/iuK?= =?Windows-1252?Q?kjEMnMuQbHLM5552aIwKBJ9Wh5gZDDs/ZycB9E9W4dxUVMfbmyOcXRhv?= =?Windows-1252?Q?LCI0nZ9fILWdB5Bd0m0eJxALjliPmsL+/tL8RuYkbOQkmSHveQSRz1De?= =?Windows-1252?Q?1PPMInk5yWXL8XqDhZbeoCbP3Di9GjpaH+Dgf/CQfTMgbKFI9qsIo3Nm?= =?Windows-1252?Q?FlAJzFvtJ6X1aZUW6bQoQfGT4vYM5y+n+sobYVV/v0+62dMzXK8lJ/EW?= =?Windows-1252?Q?LFSYGOrJOf1ZKzob+VtHzN6OIgAVjCrDDlYqgvVdYDGsRPamFSVBo4G7?= =?Windows-1252?Q?uVRQ0lofT1IvSt1+G0rW3AZKEfIPwHQrUusyKt154p2wLiUfsWEkWLAE?= =?Windows-1252?Q?n0jY9HmybjYJScYVV7WvMORoWRTXizFegOfhILvPKX/I0F+UEQLDHmez?= =?Windows-1252?Q?Qxq7Pq1XfV75uHFh1l2tmmYDmErzOVAw0UAlORu22wKdlE+1mJxTmrAF?= =?Windows-1252?Q?uQf/FoMe8wZUmDPR2AJulG0hXyAIaIJ0U0PEGX4s8zeSuIOEmCr27Wqn?= =?Windows-1252?Q?rQ+KafT5Ev2XAXO27F0N1Ck7wfC4Tb94VQ9mXhKpcUF03s4FxwFMJV4e?= =?Windows-1252?Q?Lr91gYh5wyDYs59OzfD03rEesA/CC6YDrfvevm/iKgsCUKU04L8Ibj4l?= =?Windows-1252?Q?tk5IIDJ8k7jc+zzBfVbhB7IFnH5DVdQl9o0u0jvEl3YMRdNHeqTY2cTy?= =?Windows-1252?Q?kkzXtnsQKD3+6EVPAJfrqD23QGgVOP2XSXGDGG5ZlikfgrSqjs6MOMHi?= =?Windows-1252?Q?QCkGA/x2ikrEZpuoVKsVx0JKPo0WHZG3dxdhMXLeV1COi8vWpx1jg1KH?= =?Windows-1252?Q?eQf6LprB5ycWzoTeNaH0ECBgw+l1YkkKgp7oipCkGn17e7/axIEVOhXC?= =?Windows-1252?Q?Mj42KBrQCreWizGSMbxEXfQbl7SSGuZIQG2yn9Wy5jABhhX8Y0vdpHXZ?= =?Windows-1252?Q?5o9f+H6KwTL9rjxTSqACckPwyZht0/GqiTljocXVUkANHR64b7rf6+WD?= =?Windows-1252?Q?sPaec/hjaIBIMtltqUfhWGrNYvzL0iUuymm3RZCIM43XVDp8CBQJfx3m?= =?Windows-1252?Q?qyxN0HlXrxnK26tp99z+E9TALyP9KkfWiC7nTu464Q7KPh8qlX9LpW+r?= =?Windows-1252?Q?kp7jtEKQ5tIWvxrW1DID3abAYkDBP1tc58wjakRoCK3r/BsLOsG4RhbK?= =?Windows-1252?Q?ClWikraTd6OQNjU4AxlGK2SQqMIKGVtD9KC6SuPUtqdCmsLpWTZ2xuEb?= =?Windows-1252?Q?GZzyzoSQEwn7F+A/KzuouF+Fqb2wcScMqwNZF/aAIOJRaxw48p6MSqR6?= =?Windows-1252?Q?vm0af/qzicZKhjWS1U9fibJpERTO3fb/gXkBpmq/jbewKxp2DeyzPspv?= =?Windows-1252?Q?B9uO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L7NA80bonYRJtPPdEMsiaQv0dqEgP53TUWhaXQfNLW+1qaMvGseVddcZpXwzJLOHaQdMlKe0omXfUURMnNjjUitSbvJKoD5KI=;20:MT1pM+IjOXT0kr/71cwUvxB9VkwKTgNbu3yQvD3exSlwF/vqzneK/N8kNkDwsnZBG7c9UOZvxDW/Qi7Vcs3fwYJh7fP4l5oZzdMURTL4SX5McSUAl3XrKe2GM+fWwz/BerITyZN5SGchvpwj5z2Jl0WfgUcpQIhQ/DVuxOLbaqO10ienUP/o5vhorR9ib7g28fK60A4JMpFpnOgWum1t5NDFLLHgwt8z2Ivfa91W8zci8vFuv5rjOKP581jF4U2M X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Nov 2016 09:45:32.6243 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1306 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 832 Lines: 18 Am 24.11.2016 um 00:25 schrieb Jason Gunthorpe: > There is certainly nothing about the hardware that cares > about ZONE_DEVICE vs System memory. Well that is clearly not so simple. When your ZONE_DEVICE pages describe a PCI BAR and another PCI device initiates a DMA to this address the DMA subsystem must be able to check if the interconnection really works. E.g. it can happen that PCI device A exports it's BAR using ZONE_DEVICE. Not PCI device B (a SATA device) can directly read/write to it because it is on the same bus segment, but PCI device C (a network card for example) can't because it is on a different bus segment and the bridge can't handle P2P transactions. We need to be able to handle such cases and fall back to bouncing buffers, but I don't see that in the DMA subsystem right now. Regards, Christian.