From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from BL2PR02CU003.outbound.protection.outlook.com (mail-eastusazon11011054.outbound.protection.outlook.com [52.101.52.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 75DE43E9C1E; Mon, 1 Jun 2026 18:17:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.52.54 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780337852; cv=fail; b=pnO4fIYe1feRT6q/naYE19iZ1fbj7CmnqRQHWvqfyTE0BCPgbTA9oELpsxL5o7u9SxUViRLXpsr6z56O1qZrVZ9NBF37zPLo7l5zAA03NeNGcCbmtoZWEf3YQh09WTgLS060HCynL8UO3i7nGZ20Hb46KnUTQFLXMPWhoNBkk4U= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780337852; c=relaxed/simple; bh=XeFZk7cAAG6lUWBAk3W9UwqKZO9VdRTsc7ytfGrBdco=; h=Message-ID:Date:Subject:To:Cc:References:From:In-Reply-To: Content-Type:MIME-Version; b=MGCCgJq52cZzA5NVyVM5MV9c02FXKSjT8e8nZSi5SR5CfB8+x8MGBUubChyRdoZWy5D5j1b83YpjqW4UfXJQbjnwzKNlYbGkbxd7YT6HyVkUFGjt+KmNkPqg4UkhTfxoEmJ75gI2ge+vppzK7iCwKFP+hlVqrbzbyCx1Y67X5Uw= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=ioD+Aa7K; arc=fail smtp.client-ip=52.101.52.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="ioD+Aa7K" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cNqHuSoG9G9SiYFsL44EGGTrwQvNYsXYLJchfTzpG57lJPcmyfEDMT4pspaoYKMC0kTmPYm5Oy1czpe7a7vWUdz2VJHCKX7o3cGkVFppvjp+zDZvl8tYpi/W2cOVpHcQ3eP1M8uJ4NNdmcZN9dLjiEz3RBZW07pratFHo8hrhvbrflFPXtSfkuUwti5s8KJKO1luWPhgWywoOx9z+GH8bm5iOJQnQwk0QFOMH590y5JZ5bXjDgyJbnaDvsGhy9BZYBb3lSdcgdj5tJauJS2dAKaNHpdoJuWl2qAZaQZ/+xOsRuG7gvpDAhvxnwjE72O0BUDbXNPU8GevSaBP5UcfVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Yx9FY8LA5mQhznJL03ZONts/ChEQOkybRbJMeLw6pnc=; b=M/vLqtwMiS36KVyup6AlvGpv/7RZyi8Bqi868OWe2pyNbQYhT9fbXGncDKa4PlVNtGDikVS3Ql7vDwNyHGOqHZnhQeK0Gl94EIQu1vPAVgIvHzDRkYuFMw+yqRXj2FZt20g4hfc1hjlOjT+sZ9uz+y8QMJgPSzKM6tBznH2OZ9mowU7N3lp+15GATLxUcZdtL6AwRPdw14VoxMw2UAUKQPYbcB8L3YpWLAkGM1KkQo7VbxTtiiLpfvgIpaeh7kZKGDi1ZyOdPpMrRwS8fqi5Yim77YmpQ1x8hGRImP0mrv1Ud8Pk7g3ybwRRyOGdo/I4G+qeLNPY22DabdldsHO65w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Yx9FY8LA5mQhznJL03ZONts/ChEQOkybRbJMeLw6pnc=; b=ioD+Aa7KqCfBa4TgrS1bW8g/pMfOC6O9GbFjBMNqxjjbN5iHwLeFkRma1iNUsn0EmDoyCFFzIiCTQlsXT77/imzPuOyhxE/0xbfJ3AEjlXxioJKrvWxq+MxdgPjOHFlUx7DVQFJ9LNzJen919z/SwmZlGqSXiA3l0HqBBgYFgoM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from PH7PR12MB5685.namprd12.prod.outlook.com (2603:10b6:510:13c::22) by LV8PR12MB9359.namprd12.prod.outlook.com (2603:10b6:408:1fe::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.71.16; Mon, 1 Jun 2026 18:17:21 +0000 Received: from PH7PR12MB5685.namprd12.prod.outlook.com ([fe80::ce69:cfae:774d:a65c]) by PH7PR12MB5685.namprd12.prod.outlook.com ([fe80::ce69:cfae:774d:a65c%5]) with mapi id 15.21.0071.011; Mon, 1 Jun 2026 18:17:21 +0000 Message-ID: Date: Mon, 1 Jun 2026 20:17:15 +0200 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 0/4] vfio/dma-buf: add TPH support for peer-to-peer access To: Jason Gunthorpe Cc: Zhiping Zhang , Alex Williamson , Leon Romanovsky , Sumit Semwal , Bjorn Helgaas , kvm@vger.kernel.org, linux-rdma@vger.kernel.org, linux-pci@vger.kernel.org, netdev@vger.kernel.org, dri-devel@lists.freedesktop.org, Keith Busch , Yochai Cohen , Yishai Hadas , Linus Torvalds References: <20260527121438.GJ2487554@ziepe.ca> <20260527123634.GK2487554@ziepe.ca> <71302a7a-6b9f-40da-af81-b1862dbd637a@amd.com> <8d9bb0b7-182d-4930-b683-d5d24da6b2ab@amd.com> <20260529201130.GU2487554@ziepe.ca> <190a1eeb-bd70-4b7b-93a4-60e14f0d6c7e@amd.com> <20260601174734.GB2487554@ziepe.ca> Content-Language: en-US From: =?UTF-8?Q?Christian_K=C3=B6nig?= In-Reply-To: <20260601174734.GB2487554@ziepe.ca> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: IA4P220CA0011.NAMP220.PROD.OUTLOOK.COM (2603:10b6:208:558::11) To PH7PR12MB5685.namprd12.prod.outlook.com (2603:10b6:510:13c::22) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH7PR12MB5685:EE_|LV8PR12MB9359:EE_ X-MS-Office365-Filtering-Correlation-Id: 272d8bbf-52aa-450f-6010-08dec00a0579 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|7416014|366016|6133799003|5023799004|4143699003|18002099003|22082099003|56012099006|11063799006; X-Microsoft-Antispam-Message-Info: sumCnbjVyH84fMyuyA0F+4HdGVmXKAnVUk0dplayfl7BY5V146ja4WnghI9RCyNZCz06gpXv4KowZEnvpU+y5t1x7mNZqSSVa/URn6l6xRjuD054XM1BbcYHJzJfh7izPqsxRojWum+lsD9jtyWEbnqBWiRoPIb1ToWew1U06Rt2wcAvGggPr0zbQaw7ZTg46e8vM6gQBheeqpEZH2fLq6dLRxNjuAJj98M6XxMVmCDblO/7/QUr/zkXTiGkdTuI5BUkdKabbb2/P/PaFTlt3xl0+qOthPn71PI9y5Ano12olc0nJZPi9Hur7duoYU7AG2EJD3WG5Fty+WP4RX0Ikmttsq6hHu5ePvqsptoTV85YfRRIeQ29+OmKTdmpN4U3ucituR40rlE14O7SjT1ZIwK6B3L2SqdmeP8bKjN+XGpwd+MBPjx8zp2rpw8ZEHYoB0ahLv4Cwcg7YcV2LSxGYRoljDskGbCcmrMzXUyFjDNZws1b7bAuGwrV7EOiHIHwM+ZgtchF8H0aWDiufvhHgowQTjjrJDyP1CZz0bDeY529M26mwEQePHBg3OzV3UzFMnRcqoJ5n8kwZRkH03MmwF0qzLlsSVhStLrtZUlI8F6eI1L0vE/TkFNKmOfKMXQsPV5eMFfBU3E+NKhzQVVF9vkxlKN7t3kccVNF7Mm5m4wKyd8/F7pG0WJ500gPF5Nt X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH7PR12MB5685.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(7416014)(366016)(6133799003)(5023799004)(4143699003)(18002099003)(22082099003)(56012099006)(11063799006);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SWMxZHJETkJqNjJOa3JhMXVqaXdrdzNZcUpjL0o1T1M5aHRTMmpqUkZsMDJk?= =?utf-8?B?KzhabFFoOGV5K1ZRVUZZNzF0NWsvQlo3RG03WG9GR2lSQWE3Y05tUlgvWGJn?= =?utf-8?B?NWVCNDA2ZnJESEYwUUNvZG9yOUorV3RTME5WaUZaU1J5UTFCNVh1TEtUcHQ2?= =?utf-8?B?eVV4MmNJNXhlditsUlN0WlU1eFk5T3F5VXA5c2ttc25lZU0xTkxIMy81dDl4?= =?utf-8?B?VEJwNUdFVlBGVlZ1cWJVZnlZK2VSL1hFVnNKQzF4YlJJc01IZm1hY2dqejJV?= =?utf-8?B?S0NvWmVqbVZFVVBqV013Zy9mbnJrOWZST3BYN3d5ZVFXUGNLZERONUY5c2cz?= =?utf-8?B?cE9hSTI1akhxMWtCdXNielJmbGtHRVl2RXNZdStuW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QkxJK3g0K0lzQk0rNlRwYXN3b2lNWkc2KzBRb2tORk1zVmdoclViS0I2NmdQ?= =?utf-8?B?aUMwVitETWRmV2ZuVTZ4SkkzOE9GS2xJYzV5Z09QYUJYY2ZCRzJhSUJlS1JX?= =?utf-8?Q?xR/OdxP8ZsXSmch59W?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 272d8bbf-52aa-450f-6010-08dec00a0579 X-MS-Exchange-CrossTenant-AuthSource: PH7PR12MB5685.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jun 2026 18:17:20.9571 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: oeT9AAq5795w8gdHNmI0d8IWBIgq2D7yr8F70r0sEy43l+W6Nk3qzKdL4KUFO6t2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV8PR12MB9359 On 6/1/26 19:47, Jason Gunthorpe wrote: > On Mon, Jun 01, 2026 at 11:59:55AM +0200, Christian König wrote: >>>> When you have a complete open source driver stack which utilizes >>>> VFIO passthrough as the interface to communicate with the kernel >>>> drivers then we can eventually talk about that. >>> >>> That decision is not up to dmabuf >> >> Yes it is. This is the DMA-buf API which is added here. > > It is a DMA-buf kernel API that is added, I think it is overreaching > to try to veto a VFIO uAPI that calls it.. Well as long as that is a private interface between VFIO and mlx5 I have no objection at all. But when it starts to affect DMA-buf I need to make sure that it works for everybody. And without even being able to test it that becomes really tricky. >>> - what VFIO subsystem requires to >>> accept a new UAPI is up to the VFIO maintainers. >> >> As far as I can see vfio-pci is used as a stub driver to avoid >> opening up the real driver. > > Yeah, that's probably true. > > Frankly, I'd rather they use VFIO like this than to upstream another > driver for proprietary custom built HW which nobody except Meta even > has, let alone can use. Yeah, that's a good point. >> Upstreaming an API changes only makes sense if others can use it and >> this here is something completely special to this particular use >> case, without all components involved nobody else can use it. > > It is not 'nobody else can use it', if it was true VFIO wouldn't be > leaning toward the uAPI being OK. > > This exposes a PCI SIG defined TPH capability in a reasonable simple > VFIO uAPI that can be re-used by any other device that happens to > support TPH on inbound MMIO. The uAPI has sensible general semantics > based around the PCI spec. That it's implementing an official PCI spec is a good argument. But on the other hand looking at the spec it's not really specifying much since everything is architecture specific. > Anyone can repeat the demonstration Meta outlined in their cover > letter: Use this new VFIO uAPI, import the DMABUF to mlx5, use a PCI > analyzer and you will see the PCI SIG defined TPH bits set the way the > VFIO uAPI says they should be set. > > There is nothing uniquely tied to Meta's device here, or unusable by > someone else's devices. Arguably this is actually a mlx5 feature to > allow VFIO to control its TPH generation HW. Would it be possible to demonstrate the functionality with some FPGA implementing an PCIe endpoint? Doesn't needs to be anything funky, just the ability to exercise this for basically everybody who can spend a few $ on the HW. Regards, Christian. > For a long time the general kernel has had a philosophy that as long > as these niche features are generally implemented and *in theory* > usable by anyone who wants it is OK. Every knows the initial userspace > implementations of *alot* of stuff starts locked up in proprietary > software owned by database, and now cloud, companies. Yes, some > subystems are stricter, that's OK too. > >> So as far as I can see that here is a no-go. But at the end of the >> day it's Linus who needs to say if that's ok or not, that's why I >> put him on CC. > > Well, based on what I heard when I argued for fwctl, and the > discussion with sched_ext, I don't think implementing functionality a > standards body defined in a logical way is going to raise concerns.. > > Jason