From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796429356; b=aMAMCD/Cx9Bng7QYAb6RvqFCKA1AI+nvf58vg5bvqO2zp9Xq5dbLJ+DTolpWa9D1n+It iDpsekvXcCePNNtO7MidIff/tJdocwUp6MKq1RoZTpgCZZSl7cobgVyVdZ/Ny04NKFg86 kBHYeoKsOAxz/YWuH6uPOpJ+8f5zoEdF4HjBxfIpeyX3tYg/1MofqtOWClPS4o1aGZ72h oCTNE1/o9r4DVQocOuS3+yQstPSaf3mRjBvsfg+G1mWOPv+5alSR4BBOj+24HsaypuBWl Vdu7b5E9SxEVWJy36XoU6AiWHiu5m9JFOFAqr1HSDa8ULYkLN7gX/HreY/D/J/mNu4A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796429356; h=Received:DKIM-Signature:Mime-Version:Content-Transfer-Encoding: Content-Type:Date:Message-Id:Subject:Cc:To:From:References: In-Reply-To; bh=uF/2pYpCyg+9GqLX/ja7tkjIEMSGXcyCO7rbZZNK7m4=; b=vzEbC2lWvhh2ByoWvLOSWwWEaa+6Y+e8dkQgJe48OVvol+Tki1Sh+Iimx2sCyzXhCJhP pvKNjYYU6UvV7q8+H8kVRu7F/WhYmAdBQnpV52ecECr8k3p22js14WWHZxZuwYzcKS3Mj i7D0gFXJ+eVlbU2n7q0oKWa5302Ki088jOgBaSLlmWloApzYBTxsUi5nyKmWB5erjdC3V G4GrKpv5JX4vDt638wA078N1pF3S8xQX6pjygjkOW8SAbV8RuGctFkau2O/ixeupwITMX tBNi+2ZdCap1JQVMHTJVEvu4KbpVnk5juavfHl6sLIkgBuTtiEbN/o8YKOCYxSkckQg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="dIh/9L/E"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C19C606A322; Sat, 5 Dec 2026 00:09:16 +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: 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-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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> 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;