From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=40.107.209.34 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796395782; b=MwZL9I5ZgO/NcmjDjQwKs+FRXT9xfdjL1OimMDJDd3tNaAkiDyu7Tdi12hF3TQaBLNva W4j0IJF9BJTL+LG9kEQGFj6tH/O7qA7y5CQWsrRJOy3I57m0c5TkaEike2p3EDm2QIDHS bqQcN6gqjUFfU5YvLl6U14UqwDl3KU9uu6CggJxEO+z/Y4+PjM+ai+3aJD8Ppx9kTdvnE qBg+OpUfnLU72F9UnqgF/G5dfZUWv6+u+Kil+JUZxnsAZLbdsqcOWxnpsZYLggHEzE8xk MF3gqUJDMBWWW1A2Io6ZmUsmJTVSietNn5JqG56g0eFZQVHVX0VnC+lGrpdMBreGOQA== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796395782; h=DMARC-Filter:DKIM-Signature:Received:Received: X-MS-Exchange-Authentication-Results:Received-SPF:Received:Received: Received:From:To:CC:Subject:Date:Message-ID:X-Mailer:MIME-Version: Content-Transfer-Encoding:Content-Type:X-Originating-IP: X-ClientProxiedBy:X-EOPAttributedMessage:X-MS-PublicTrafficType: X-MS-TrafficTypeDiagnostic:X-MS-Office365-Filtering-Correlation-Id: X-MS-Exchange-SenderADCheck:X-MS-Exchange-AntiSpam-Relay: X-Microsoft-Antispam:X-Microsoft-Antispam-Message-Info: X-Forefront-Antispam-Report: X-MS-Exchange-AntiSpam-MessageData-ChunkCount: X-MS-Exchange-AntiSpam-MessageData-0:X-OriginatorOrg: X-MS-Exchange-CrossTenant-OriginalArrivalTime: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-Id: X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-FromEntityHeader: X-MS-Exchange-Transport-CrossTenantHeadersStamped; bh=efs6ipqthDSncXEijpzNLBPIw16MXPBmjAZsbc73TwA=; b=FcWU0cgg2W1ln0p3V5AH6djL/YA8voNLFrEVerGGcZE78rHHwNi3CL+qduyiVMjwGIp6 nbnnmjg5xl2KSWJjrr6Rf8EPtDBOEU3JbeKHncAlkinaOpMUSJ4w26MD58T3vd6sdScSW HqG1j+jPhMdKYdI06r87QqAMjYqlQWexya5378/arZgUk7N+KXE5qzMg7QmsSWFZEAyyi 0xXnsqK9LAd2ctK7+8XUZjyvlaGuMbrdWlr8PzGQuafmkkZDtDaNSOEkxbha5RfzDI7ZD +r41SCfvz/d3xm/F/5WAmUAYNuqR/cI9Ys02yTJeVmGI9Tu+0H1+gIe0pBz5itrz33g== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=my3Gp3J2; arc=pass header.oldest-pass=0 smtp.remote-ip=40.107.209.34 Received: from PH8PR06CU001.outbound.protection.outlook.com (mail-westus3azon11012034.outbound.protection.outlook.com [40.107.209.34]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (secp384r1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A6AAF606A332; Fri, 4 Dec 2026 14:49:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A6AAF606A332 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.a=rsa-sha256 header.s=selector2 header.b=my3Gp3J2 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NP2rKKt6024rBTERHm3lcm4Z7o7GrwaLEEyFYWxH41JqpyF3bPqFnsaKMnDJJrXJhMNXPQf6D1RpAcaDu18tE4AbdUHMHCgB+IfSEoFMGhDQtcFvHbDMyXI1/JB8kF2a4dXizeZjppjEFsbmGxVPZesfxfIl88N3ffzAboGQYtCOZf0+dAuMzwMrLjBu4QigmMDB7Cjr7VeS6LXon6u0L7rK/TAbJ71S/HrvLi4bbQmcoocO0WIvC6cOxKDVxor50GhQL8dx3rT60GR+KZE+Gk5dwid6cht9D5vLjmBcFXlxx6bb64BOBn3TL/VlspdkhdZ9/mVKmJhjKCxG9ZOZyg== 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=efs6ipqthDSncXEijpzNLBPIw16MXPBmjAZsbc73TwA=; b=UaxOVrd6Gx9cBZvzeNe5PUpdJuHAZnVbdQTQYNXwNVcKXzdJGDI6hQJkRYkp38z30gMaRYhWMaO5lWxjOfvE3IzMXM5a6ziR7+Cm/E9oOge//68SWCEeUB12BIPvyH1u9QnFGjc7WAkwsFWHh6VrpUdJxA/HFb61oSOKj09u2et8jzGlEsBT1VFFxEUwoyqsDYOSv1TQfzTBNpx1OTiGrB23mg6MIH143UP07EbJ9UWH/5/R1YY57AQnEU/P6GXYDYpT02uPj/w0gFNgs4VBcHe2dJ9DmCK2piOM9JOXug7Os/g0Hhr1BGVkCMgQucwaGmUNPyDKHqKvmMnFkTCDUQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=kernel.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=efs6ipqthDSncXEijpzNLBPIw16MXPBmjAZsbc73TwA=; b=my3Gp3J2NnklaQJVjBRGJtEfaZC5ki8x9s+4bCrX4RSiy8ZU1Vn3dc2il0UHACLCAIYS8liX6+j/lF+U+McE6b7NNGjksacmBtgsF4S+87TVI12wKU+yjPLIUfwpsiQvU5Xm37ug97oe3RsbR78sSDaZmQT6AH/ubL5DZd13CY7Ay7dXNGaEujOfdK4Dq2i+XyXCHbXidr83o1iGbUWVwGuQdt/1xUvDYBSuPLHuDvVawHAifB0ca7MGsHZjsVYae+RefF3/JR0O124nSisy1uh/G8djmHlHgHuFRqATD1kud7dXMFNhfPbF5v7oO3FNllwsfUQGqlTXYRTEvXGMjQ== Received: from CH5PR02CA0021.namprd02.prod.outlook.com (2603:10b6:610:1ed::26) by MW3PR12MB4459.namprd12.prod.outlook.com (2603:10b6:303:56::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.11; Fri, 4 Dec 2026 14:49:32 +0000 Received: from LV8PEPF0000005F.namprd02.prod.outlook.com (2603:10b6:610:1ed:cafe::5c) by CH5PR02CA0021.outlook.office365.com (2603:10b6:610:1ed::26) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.688.13 via Frontend Transport; Fri, 4 Dec 2026 14:49:32 +0000 X-MS-Exchange-Authentication-Results: mx.microsoft.com 1; spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by LV8PEPF0000005F.mail.protection.outlook.com (10.167.245.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.709.6 via Frontend Transport; Fri, 4 Dec 2026 14:49:32 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57; Fri, 4 Dec 2026 06:49:13 -0800 Received: from xinmengs-dev-vm-linux.nvidia.com (10.126.231.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57; Fri, 4 Dec 2026 06:49:12 -0800 From: Simon Song To: , , , , , CC: Simon Song , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , "Liam R. Howlett" , , Lorenzo Stoakes Subject: [PATCH v5 0/2] vfio/nova-vgpu: add the NVIDIA VFIO variant driver Date: Fri, 4 Dec 2026 06:48:53 -0800 Message-ID: <20261204144900.286240-1-xinmengs@nvidia.com> X-Mailer: git-send-email 2.43.7 X-Mailing-List: rust-for-linux@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LV8PEPF0000005F:EE_|MW3PR12MB4459:EE_ X-MS-Office365-Filtering-Correlation-Id: 1c906862-dda0-4080-4a32-08df5215ce89 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|1800799024|36860700016|7416014|376014|23010399003|6133799003|18002099003|3023799007|13003099007|261021135927099003|260925022911599003|10067099003|260925021911599003|56012099006|261022115727099003|11063799006|260925021311599003|261026140227099003|261026121527099003|261021130227099003|261022113327099003|261102123227099003|261022105027099003|261009223027099003|261021123027099003|261022075727099003|261028144727099003|261026130827099003|261021121427099003; X-Microsoft-Antispam-Message-Info: NQ/UexdP/Dl4pxb8UBmsgK+hZ4PHtjI2TZf0rBq6VoOL+Os0n+s07cLPn1Je8aZ8H6NadQ9yvUZsoeq/8oV1wCaKTkihLtcPur3NFc4+WVogv3UVqBUTZHcygM2bBHMg5HHUN6irKO9KU0gMbQzD0byxeND6XMqSFGFXrLUlVDiZPiwmmtcV/NIniEX2WCtIFgLypBSg98ocIQ640DyZHsofBuZVoqidVaF/+XQjWxZZCEer+Ipt8AutagiCvamlVXqhwu3FNJzgO1OvJzFVgDBbuNFKdP7rXJ8byopLyV6v3ltmSo0n90t6w1Rw4/uswuH6kRgbE592hF5+HZvUYAUl23ApBMEKmCjrY0+boxIJXE/IxI4awmn94cdve5LuxbpiKpyYz/CKT9kE40GvqlCXJEhYDDD/K8u5CMtBqU8vTqG56U0MYEurClvt9YkUZzKULFX8VMtxWfmTX4sEA/A48I1vdjcLOs6eO1pEu9vvnqPwuEC6uy/WqOM68WkdSxVTvBAjNwocCVX79uMO6WnmMXF9o6Xi2UCD9jhUfsgB80AbNwe9Y0yfZcZRcdHXvjjCrvI4Hv2G5wxLlCvqgBVUcsQp+JAZAvnIcAx2ByxFiow65xhRlh3XC2E28/qlkkj2faQaO3q5ghO+eS0rNb32s53gw8HjtBL1QJRuwzqQnes/s8ZM5xjaBgwGyvJhJ7oodVXqvTOPvE6yqiitWQ== X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230040)(82310400026)(1800799024)(36860700016)(7416014)(376014)(23010399003)(6133799003)(18002099003)(3023799007)(13003099007)(261021135927099003)(260925022911599003)(10067099003)(260925021911599003)(56012099006)(261022115727099003)(11063799006)(260925021311599003)(261026140227099003)(261026121527099003)(261021130227099003)(261022113327099003)(261102123227099003)(261022105027099003)(261009223027099003)(261021123027099003)(261022075727099003)(261028144727099003)(261026130827099003)(261021121427099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gyWitZ6YiGNMkefg8bjQJkn1l8pQNEej7Ko5O4xwKGlJroYVsBzMgGD6TkE+fZTr2Nadl0VaG8DaQQJIKtgf2j+c/dI2oq1GiIm/O2LlPb51fkdO/hi0GCrHjbKFaol0bAdCgRsLs31Uy5ZxSic+kDVtIvw/r3nUABhJShKRYA3qAvU8bYXjw69ZaaHCWf0FpsdGLvnc/FyEJYXseWYWIXJC+vh8D/ei+ce/zmk73g9dT0XW0ATU/frw6/FlJQkCI5xxxvplQyDnX50WfgLS2uM5YFgjf5hFnn+8Fv2pGZLRpkBnAT6D382eEwd/T9++EQPpxfBPWxiFy5K2vLuev9KjOKO6+cIs7pyVvq1vT9w5OHCT1IloXTpl84iDAwirePlPjTaVp1Yf9Kd8eQdJ929yqdbdfDx5Tg3BmS3jQUvJ1/fP8BUGgOQ+hp8evbnT X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Dec 2026 14:49:32.1317 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1c906862-dda0-4080-4a32-08df5215ce89 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: LV8PEPF0000005F.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4459 This is v5 of the NVIDIA VFIO variant driver. Up to v4 these two patches were patches 4 and 5 of "Rust VFIO PCI support and NVIDIA vGPU driver" [1]. That series is now split in two. The first four patches, the Rust VFIO PCI abstractions, are posted as [2]. This series carries the driver and depends on [2]. Patch 1 publishes nova-core's typed SR-IOV PF interface. Patch 2 adds the VFIO variant driver, which uses that interface to create, reset and release vGPU instances while VFIO provides userspace access to the PCI device. This series depends on: - v5 of the Rust VFIO PCI abstractions [2], and - v6 of the vGPU manager series [3]. A branch with both and this series on top is at [4]. To bring up a vGPU, userspace also has to assign a vGPU type to the VF. The tools do that through nova-core's fwctl interface [5], which is not part of that branch. Changes since v4 [1]: - Split from the Rust VFIO PCI abstractions [2] (Gary, Danilo). - Patch 1 (v4 patch 4): rebase onto v6 of the vGPU manager series [3]. - Patch 2 (v4 patch 5): - Reset the vGPU instance in reset_prepare() again, before the PCI reset, as in v3. A VF FLR alone does not release the guest's resources in the firmware. Only the PF driver can request that, and the reason is documented at the call (Alex). - Refuse VFIO_DEVICE_IOEVENTFD for a vGPU, since the VFIO PCI core would write to the BAR without the BAR1 limit. - Use UserSlice for the config space read and write overrides (Gary, Danilo). - Use the RegionInfo accessors in get_region_info() (Gary). - Follow the abstraction changes: Registration::new() without the driver type, and the renamed lifetimes. v4 patches 4 and 5 are now patches 1 and 2. [1] https://lore.kernel.org/r/20261127224928.1511382-1-xinmengs@nvidia.com [2] https://lore.kernel.org/all/20261204041727.4021092-1-xinmengs@nvidia.com/ [3] https://lore.kernel.org/all/cover.1796191007.git.alkumar@nvidia.com/ [4] https://github.com/xinmengsong/linux/tree/nova-vgpu-vfio-v5 [5] https://lore.kernel.org/all/cover.1796197508.git.alkumar@nvidia.com/ Danilo Krummrich (1): vfio/nova-vgpu: add the Rust VFIO variant driver Zhi Wang (1): gpu: nova-core: publish typed SR-IOV PF APIs drivers/gpu/Makefile | 15 +- drivers/gpu/nova-core/driver.rs | 34 +- drivers/gpu/nova-core/nova_core.rs | 3 +- drivers/gpu/nova-core/vgpu.rs | 1 - drivers/gpu/nova-core/vgpu/vgpu_api.rs | 171 ++++++-- drivers/vfio/pci/Kconfig | 2 + drivers/vfio/pci/Makefile | 2 + drivers/vfio/pci/nova-vgpu/Kconfig | 20 + drivers/vfio/pci/nova-vgpu/Makefile | 3 + drivers/vfio/pci/nova-vgpu/nova_vgpu.rs | 522 ++++++++++++++++++++++++ rust/bindings/bindings_helper.h | 1 + rust/kernel/vfio.rs | 3 + 12 files changed, 732 insertions(+), 45 deletions(-) create mode 100644 drivers/vfio/pci/nova-vgpu/Kconfig create mode 100644 drivers/vfio/pci/nova-vgpu/Makefile create mode 100644 drivers/vfio/pci/nova-vgpu/nova_vgpu.rs base-commit: 1b2c8b267ff3c9a8c83b7524debc637de02ee32b prerequisite-patch-id: 6cfd7afd456e2122926d365321b00321036b9f2e prerequisite-patch-id: 9228595f76dde48297670da5be99228c11fd917b prerequisite-patch-id: 36f4f21082a9b20f5c75ce2e1a6fcaca39e2c1bf prerequisite-patch-id: 3aa22f5e6eb0d188b6dc00bea385f1bc07aed2d6 prerequisite-patch-id: 741e15ad117e9018d6c568904cafe98e4f407acb prerequisite-patch-id: 88d67b250d7c1b36afa23062ed3a712952e53490 prerequisite-patch-id: e8c13a777d612873aef5f8528b8360203981c3b3 prerequisite-patch-id: ca19c76a3af38d83a09e2b838225d5d22f3a58b1 prerequisite-patch-id: 4af23dd1b6074197be42ae98dbfb1214d020f5e5 prerequisite-patch-id: aa564955d07ecf6328d589ef175050933f12229d prerequisite-patch-id: 2d77cbed5133696f05afffe0bbdf3cd2aeab9c30 prerequisite-patch-id: 7891b8799b904e8c587f7f68e5392ba936516d17 prerequisite-patch-id: 6e0a59e846fbb633b473c9b7e3c171ad859319d9 prerequisite-patch-id: dd31a51c79b2ee7a1870b3c5009f9fbe6e7b1d3d prerequisite-patch-id: a45ddea8f025622742b378c3c5573498e66f39da prerequisite-patch-id: 0cd47cf0b17fb9affc0099f7855d80c830c39e58 prerequisite-patch-id: 8bfda508149f5d50067673061fcd9987474a257f prerequisite-patch-id: 9384489c5d19741b1cee28cb071f8f716fb0dc4f prerequisite-patch-id: f29998e45c8372cc908d5237228f91d42c3e43ea prerequisite-patch-id: b481e232431cb851412ffdf6a9b7a44f47bc29af prerequisite-patch-id: 4be056b9e82b70bfece963bfd086581fb401dbcd prerequisite-patch-id: 0b230677e51e12e58490d73225dcb713bc44a478 prerequisite-patch-id: a16a85dbc2894235193a72d59b259d2238bdb913 prerequisite-patch-id: 3f9088001ef25ffe240614642c41ad45a0624e99 prerequisite-patch-id: 7a489f3ec55dd259bc0fa65ae9d1b57189535b10 prerequisite-patch-id: 39d0211450a65d96a1db21b23ff99844ae318bb7 prerequisite-patch-id: 7b1390f798f69d262456afb050819bd446523b09 prerequisite-patch-id: 077ec934d669d3dd79a72e7b28f42304c0c54663 prerequisite-patch-id: ba4b3d4d72646658b5ce430b5c4e63ee5b048fcc prerequisite-patch-id: 9844732646e998f81007b05b7d7e25cc628550eb prerequisite-patch-id: 03a53e966692f58650e15b62ce0ba3be28333359 prerequisite-patch-id: 645d0c28e5ca61d1b6b0241508b933069d0368bb prerequisite-patch-id: bf5955cc50e5ba2969f603ac580c82164c6d1f61 prerequisite-patch-id: e5d4407b295817aa64be5de87ec299be6f9be04d prerequisite-patch-id: 48490c862395458dd1004abf6e9c2ceefca9236b prerequisite-patch-id: b317b0f2b8520334b041b50bcac0d8b69673d834 prerequisite-patch-id: 35094e8dce6326b76dd43d54aef361ba58a32023 prerequisite-patch-id: 1fe49043278361d3c07b196b4bd3229aa6aa7537 -- 2.43.7