From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0FA49606A322 for ; Sat, 5 Dec 2026 00:09:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=dIh/9L/E Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 749F510E182; Sat, 5 Dec 2026 00:09:23 +0000 (UTC) Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by gabe.freedesktop.org (Postfix) with ESMTPS id 34E8910ED22 for ; Sat, 5 Dec 2026 00:09:17 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 51B1D61359; Sat, 5 Dec 2026 00:09:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D46671F0092B; Sat, 5 Dec 2026 00:09:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796429356; bh=uF/2pYpCyg+9GqLX/ja7tkjIEMSGXcyCO7rbZZNK7m4=; h=Date:Subject:Cc:To:From:References:In-Reply-To; b=dIh/9L/EUMvHeAncLZokYxre0Py2OWDS8p1Vhn2Ccjo1rdKy84M1znz1adftnmgdn WsgvywfeSJPVM4F5rTxNtpLB1sPy2DwkobCyBPuJUb6d9LVc20R9vZOh46GrZbTYMh 0UFeBq/0EAJh2PHBRmMe3yxlhML5PjaAWMSq16hLRwPb60AI2n6XzE9P0WJ8mwr3r0 6/dpKIKctfuBz5lpyI7pPZdHuGATkVuScQ+yaOM7S1EXdtoXnajCqu+2byxoTpdw6c Xf2+Op8sMDP+zmTnAhYv1kwo2xlIeRsYC4SnDR1wR3gXg/mMoIIXLzgxxqC1Qzcrvj QnBD70BScsp9g== X-Archived-By: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Sat, 05 Dec 2026 01:09:05 +0100 Message-Id: Subject: Re: [PATCH v5 2/2] vfio/nova-vgpu: add the Rust VFIO variant driver Cc: "Simon Song" , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , "Liam R. Howlett" , , "Lorenzo Stoakes" , "Manish Honap" To: "Alex Williamson" From: "Danilo Krummrich" References: <20261204144900.286240-1-xinmengs@nvidia.com> <20261204144900.286240-3-xinmengs@nvidia.com> <20261204161200.59447621@shazbot.org> <20261204163753.4b4a9df8@shazbot.org> In-Reply-To: <20261204163753.4b4a9df8@shazbot.org> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "dri-devel" X-Spam-Status: No, score=-11.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On Sat Dec 5, 2026 at 12:37 AM CET, Alex Williamson wrote: > On Sat, 05 Dec 2026 00:28:56 +0100 > "Danilo Krummrich" wrote: > >> On Sat Dec 5, 2026 at 12:12 AM CET, Alex Williamson wrote: >> > Why do we require VFIO_PCI_CORE is builtin? This is not really an >> > acceptable requirement. =20 >>=20 >> This requirement does not come from the driver, but from the VFIO Rust c= ore >> code. It is an existing build system limitation that exists for all subs= ystems >> that have Rust code in the kernel. > > Suggestions for where we can make a RUST_VFIO_PCI_ABSTRACTIONS Kconfig > that depends on VFIO_PCI_CORE=3Dy, allowing NOVA_VGPU_VFIO_PCI to depend > on that and moving the requirement into Rust space? Thanks, I think something like this would be needed if you prefer a separate Kconfi= g for this. diff --git a/drivers/vfio/Kconfig b/drivers/vfio/Kconfig index b9d6e1c22aed..3b8a647d8ba4 100644 --- a/drivers/vfio/Kconfig +++ b/drivers/vfio/Kconfig @@ -14,6 +14,14 @@ menuconfig VFIO If you don't know what to do here, say N. if VFIO + +config RUST_VFIO_ABSTRACTIONS + bool "Rust VFIO abstractions" + depends on RUST && VFIO=3Dy + help + This enables the Rust abstractions for the VFIO API, used by Rust + drivers that expose devices to userspace through VFIO. + config VFIO_DEVICE_CDEV bool "Support for the VFIO cdev /dev/vfio/devices/vfioX" depends on IOMMUFD && !SPAPR_TCE_IOMMU diff --git a/drivers/vfio/pci/Kconfig b/drivers/vfio/pci/Kconfig index dd9b755262a4..02d7c1eebf98 100644 --- a/drivers/vfio/pci/Kconfig +++ b/drivers/vfio/pci/Kconfig @@ -7,6 +7,13 @@ config VFIO_PCI_CORE select VFIO_VIRQFD select IRQ_BYPASS_MANAGER +config RUST_VFIO_PCI_ABSTRACTIONS + bool "Rust VFIO PCI abstractions" + depends on RUST_VFIO_ABSTRACTIONS && VFIO_PCI_CORE=3Dy + help + This enables the Rust abstractions for writing VFIO PCI variant + drivers using the VFIO PCI core API. + config VFIO_PCI_INTX def_bool y if !S390 depends on VFIO_PCI_CORE diff --git a/drivers/vfio/pci/nova-vgpu/Kconfig b/drivers/vfio/pci/nova-vgp= u/Kconfig index 29fad96340ce..ec1ab3528f69 100644 --- a/drivers/vfio/pci/nova-vgpu/Kconfig +++ b/drivers/vfio/pci/nova-vgpu/Kconfig @@ -1,8 +1,8 @@ # SPDX-License-Identifier: GPL-2.0-only config NOVA_VGPU_VFIO_PCI tristate "VFIO support for the NVIDIA vGPU" depends on NOVA_CORE && PCI_IOV && RUST - depends on VFIO_PCI_CORE=3Dy + depends on RUST_VFIO_PCI_ABSTRACTIONS help This option enables VFIO (Virtual Function I/O) support for NVIDIA virtual GPUs (vGPU). It allows the assignment of a virtual diff --git a/rust/kernel/lib.rs b/rust/kernel/lib.rs index 061e22fb09cf..6cb471b386b4 100644 --- a/rust/kernel/lib.rs +++ b/rust/kernel/lib.rs @@ -147,7 +147,7 @@ pub mod uaccess; #[cfg(CONFIG_USB =3D "y")] pub mod usb; -#[cfg(CONFIG_VFIO =3D "y")] +#[cfg(CONFIG_RUST_VFIO_ABSTRACTIONS)] pub mod vfio; pub mod workqueue; pub mod xarray;