From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1BFBC606A32F for ; Sat, 5 Dec 2026 00:09:20 +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 kanga.kvack.org (Postfix) id 244AA6B00EF; Fri, 4 Dec 2026 19:09:19 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1CEBC6B05B1; Fri, 4 Dec 2026 19:09:19 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0E4DF6B05B2; Fri, 4 Dec 2026 19:09:19 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id D92A36B00EF for ; Fri, 4 Dec 2026 19:09:18 -0500 (EST) Received: from smtpin03.hostedemail.com (lb01a-stub [10.200.18.249]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 704CF1C3B62 for ; Sat, 5 Dec 2026 00:09:18 +0000 (UTC) X-FDA: 85507994796.03.84F8872 Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by imf27.hostedemail.com (Postfix) with ESMTP id D72B94000F for ; Sat, 5 Dec 2026 00:09:16 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20260515 header.b="dIh/9L/E"; spf=pass (imf27.hostedemail.com: domain of dakr@kernel.org designates 172.105.4.254 as permitted sender) smtp.mailfrom=dakr@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; d=hostedemail.com; s=arc-20220608; cv=none; t=1796429357; b=kMMPnqMacruNMFdW0KF2C2V1hTL6Nk7dX5TP0C0nN0VhG/8H9mAErauCmgiR+YcIu4bH0w wo5GTnOF3aAlXzCOZw0aIXfVpIY8DSK78+vQaH6tyhM3KEK3yq5tD5P3E5OATezyCgTWCB 15TldorTeIW2bRtflyyidaGqeCJnbU8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1796429357; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=uF/2pYpCyg+9GqLX/ja7tkjIEMSGXcyCO7rbZZNK7m4=; b=m0o3OApVWVDkL1al8ul+Hb2YxBaOT1wE4Wl5S0VwXQ8IMd+CbB13TfKJJI5b2aUc1C2AxM It/vpKXKY/yw8o2lUEgjcVXvkRRMM7TQ4KtGy48myX+X6uaT3qovdCKsaUjE6TrPnJ2UXw Dw2rIxL+z09w7n14vmZxZ6oACqwLVng= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20260515 header.b="dIh/9L/E"; spf=pass (imf27.hostedemail.com: domain of dakr@kernel.org designates 172.105.4.254 as permitted sender) smtp.mailfrom=dakr@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org 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-Stat-Signature: ynwiib6sckpi4y6bfcrk8e8nf65eftk8 X-Rspam-User: 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_PASS,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Rspamd-Queue-Id: D72B94000F X-Rspamd-Server: rspam01 X-HE-Tag: 1796429356-540247 X-HE-Meta: U2FsdGVkX1/P6OtOOwjyT2v/g1dK2A3BvxMGSNSdFFi7p5l1jbmmKRPsx8b+tjrLPHMOw7Mvb6w3zqbV/8/9WjAQHrwN84s0gKsvoZUk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czeARPayanJ9j0jrFkwkmLkeAS3pOGgBmjYW92TmmBVIOpu+PhvS1ssGJq7FggzEzV5AjPxIfb0DhHwmDHaqwpzPxt2+HnZCm80nJHQ6wd1uDV1m5Sv6MUGSrkltWrP+os/PYIrpVXwWEKPKeKefBF7yFHMDGKS1qNh4vmbImCX/O6MVHs9eKPY+zwUvRBuD/Ezpx9KiCqERXGehdJN0zJcmB4qtozd5+e2/hyO9aKTugtV3mxo5BrQCp2UYqKQUzIhCZ5TAS9R4ouvZykzjvH/P33umZRXq5KoTcFobd0GYIh8hvs3S3IrmUQSuqT0uYVjANnM3o/fg0UI7DYBqIVuyJ/N0iRkiwyWy37hLf/q4gqDzg9dU6QzIWA1pc1n5y3To7HSe2VAf7xvyeguUviXmD4yKyT3ywDH2FO3G7CIiJWCcFqsFZTB8UrR32aBnexMbD4Ic Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: 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;