Rust VFIO PCI support and NVIDIA vGPU driver
Subsystems (12)
v4 cover Rust VFIO PCI support and NVIDIA vGPU driver
This is v4 of the Rust VFIO PCI abstractions and the NVIDIA VFIO variant driver [1]. The driver uses nova-core's typed SR-IOV PF interface to create, reset and release vGPU instances while VFIO provides userspace access to the PCI device.
Patches 1-5 of v3 were applied to driver-core-next, so this version carries the remaining patches. Patch 1 adds the VFIO device handling common to all buses. Patch 2 adds two VmaRef accessors for patch 3, the VFIO PCI abstractions. Patch 4 publishes the typed Nova PF interface, and patch 5 adds the NVIDIA VFIO variant driver.
This series is based on driver-core-next. Patches 1-3 need nothing else. Patches 4 and 5 also depend on v5 of Alok's vGPU manager series [2] and can follow once it has landed.
Runtime PM is still not part of this series. It will follow once the generic Rust runtime PM support [3] and the PCI bus handling for it are available. Until then, vfio::pci::Registration keeps the device runtime active while it is registered.
Changes since v3:
- Drop v3 patches 1-5, which were applied (Danilo).
- New patch 2: add VmaRef::size() and VmaRef::pgoff(), split out of the VFIO PCI abstractions (Danilo).
- Patches 1 and 3: build the abstractions only if VFIO and the VFIO PCI core are built in, until the new build system is available (Danilo).
- Patch 1 (v3 patch 6):
- Remove RawDevice and make the layout a type invariant of DeviceBase
(Danilo).
- Add vfio::Operations with the RegistrationData and OpenData types, and drop the R and O parameters of DeviceBase (Danilo).
- Use Option<NonNull<_>> for the open data, expect() instead of unwrap_unchecked(), KBox::pin_init(), and one unsafe block per operation (Danilo).
- Reword the type invariants, justify them with INVARIANT comments, and hide DeviceBase from the documentation (Danilo).
- Patch 3 (v3 patch 7):
- Let vfio::pci::Operations extend vfio::Operations, and name the lifetimes 'reg and 'open (Danilo).
- Make the I/O callbacks optional with #[vtable]. An unimplemented callback leaves the VFIO hook unset (Danilo).
- Use the VmaRef accessors of patch 2 (Danilo), and let Mapping wrap a VmaNew (Alice).
- Use from_result() in the callbacks and const_assert!() in Registration::new() (Danilo).
- Remove RuntimeActive and call the runtime PM functions from Registration (Danilo).
- Add the optional dmabuf_len() callback, which lets a driver limit how much of a region can be exported as a DMA buffer, and remove Device::new_passthrough() (Alex).
- Patch 4 (v3 patch 8): rebase onto v5 of the vGPU manager series [2].
- Patch 5 (v3 patch 9):
- Match the two supported device IDs instead of every NVIDIA device
(Alex).
- Reject a BAR1 size that is not a power of two, and report the virtual BAR1 size when the BAR is sized through config space (Alex).
- Clear a reset error at the next reset, and do not treat hot reset specially (Alex).
- Reset the vGPU instance in reset_done(), after the PCI reset, instead of in reset_prepare() (Alex).
- Support DMA buffer export, limited to the BAR1 aperture of the vGPU. The VFIO PCI core revokes the exports at the last close, after the driver has destroyed the instance (Alex).
- Do no vGPU setup for a passthrough device, do not signal the VFIO error eventfd from reset_done(), and name the module authors (Alex).
- Depend on VFIO_PCI_CORE=y, following patch 3.
v3 patches 6, 7, 8 and 9 are now patches 1, 3, 4 and 5.
Danilo Krummrich (2):
rust: vfio: add PCI variant driver abstractions vfio/nova-vgpu: add the Rust VFIO variant driver
Simon Song (1):
rust: mm: add VmaRef::size() and VmaRef::pgoff()
Zhi Wang (2):
rust: vfio: add common VFIO device handling
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 | 418 ++++++++++++ rust/bindings/bindings_helper.h | 4 + rust/kernel/lib.rs | 2 + rust/kernel/mm/virt.rs | 14 + rust/kernel/pci.rs | 12 + rust/kernel/vfio.rs | 462 ++++++++++++++ rust/kernel/vfio/pci.rs | 812 ++++++++++++++++++++++++ 16 files changed, 1930 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 create mode 100644 rust/kernel/vfio.rs create mode 100644 rust/kernel/vfio/pci.rs
Signature · 1 line
2.43.7
PATCH v4 1/5 rust: vfio: add common VFIO device handling
From: Zhi Wang <[email protected]>
A VFIO PCI device contains a VFIO device. Expose that relationship in Rust so common device handling is independent of PCI resources.
Add vfio::DeviceBase, a C VFIO device structure followed by pointers to callback data, and vfio::Device, its alias for struct vfio_device. The data is registration data and data kept from the first successful open until the last close, which can borrow the former. Share reference counting and callback-data lifetime handling in vfio.
The helpers are unused until the next patch adds the PCI abstraction.
--- rust/bindings/bindings_helper.h | 2 + rust/kernel/lib.rs | 2 + rust/kernel/vfio.rs | 454 ++++++++++++++++++++++++++++++++ 3 files changed, 458 insertions(+) create mode 100644 rust/kernel/vfio.rs
rust/bindings/bindings_helper.h +2 -0
@@ -93,6 +93,7 @@#include <linux/task_work.h> #include <linux/tracepoint.h> #include <linux/usb.h> +#include <linux/vfio.h> #include <linux/wait.h> #include <linux/workqueue.h> #include <linux/xarray.h>
@@ -115,6 +116,7 @@const size_t RUST_CONST_HELPER_ARCH_SLAB_MINALIGN =ARCH_SLAB_MINALIGN ;const size_t RUST_CONST_HELPER_ARCH_KMALLOC_MINALIGN =ARCH_KMALLOC_MINALIGN ;const size_t RUST_CONST_HELPER_PAGE_SIZE =PAGE_SIZE ; +const unsigned int RUST_CONST_HELPER_VFIO_DEVICE_RESET =VFIO_DEVICE_RESET ;const size_t RUST_CONST_HELPER_GENLMSG_DEFAULT_SIZE =GENLMSG_DEFAULT_SIZE ;const gfp_t RUST_CONST_HELPER_GFP_ATOMIC =GFP_ATOMIC ;const gfp_t RUST_CONST_HELPER_GFP_KERNEL =GFP_KERNEL ;
rust/kernel/lib.rs +2 -0
@@ -150,6 +150,8 @@pub mod uaccess;#[cfg( CONFIG_USB = "y" )] pub mod usb; +#[cfg( CONFIG_VFIO = "y" )] +pub mod vfio;pub mod workqueue;pub mod xarray;
rust/kernel/vfio.rs new file +454 -0
454 lines not on this page · raw message
Signature · 1 line
2.43.7
PATCH v4 2/5 rust: mm: add VmaRef::size() and VmaRef::pgoff()
In reply to Simon SongThe forthcoming VFIO PCI abstraction needs VMA page offsets and byte lengths for mapping bounds checks. Keeping these queries on VmaRef confines unsafe field access to the MM abstraction and avoids repeated length calculations in callers.
--- rust/kernel/mm/virt.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
rust/kernel/mm/virt.rs +14 -0
@@ -92,6 +92,20 @@ pub fn end(&self) -> usize {unsafe { (*self.as_ptr ()).__bindgen_anon_1.__bindgen_anon_1.vm_end } } +/// Returns the size of the virtual memory area in bytes. +#[inline] +pub fn size (&self) ->usize { + self.end () - self.start () + } + +/// Returns the VMA's page offset (`vm_pgoff`). +#[inline] +pub fn pgoff (&self) ->usize { +// SAFETY: By `VmaRef`'s invariants, the VMA is valid and the mmap/VMA read lock prevents +// concurrent modification. +unsafe { (*self.as_ptr ()).vm_pgoff } + } +/// Zap pages in the given page range. /// /// This clears page table mappings for the range at the leaf level, leaving all other page
Signature · 1 line
2.43.7
PATCH v4 3/5 rust: vfio: add PCI variant driver abstractions
In reply to Simon SongFrom: Danilo Krummrich <[email protected]>
Add Rust abstractions for PCI drivers that extend vfio-pci-core with device-specific operations.
Provide Operations, Device and Registration with separate registration and first-open/last-close data. Allow open data to borrow registration data, undo PCI enablement if open fails, and drop open data before closing the core device.
Let a driver register its VFIO device with Registration::new(), for example from its PCI probe callback, and unregister it by dropping the Registration. Let drivers forward PCI reset and error callbacks through the Registration. Let vfio-pci-core select its VGA arbitration callbacks. Because runtime PM support follows in a separate patch series, keep the device active while it is registered.
Restrict core I/O helpers to their corresponding callback contexts. Add region mapping helpers, and wire up VFIO core support for device features, matching, IOMMUFD and PASID. Allow drivers to export physical BARs as DMA buffers with per-region length limits.
Add pci::ErsResult::from_raw() for the result of the VFIO PCI core's error handler.
--- rust/bindings/bindings_helper.h | 2 + rust/kernel/pci.rs | 12 + rust/kernel/vfio.rs | 24 +- rust/kernel/vfio/pci.rs | 812 ++++++++++++++++++++++++++++++++ 4 files changed, 842 insertions(+), 8 deletions(-) create mode 100644 rust/kernel/vfio/pci.rs
rust/bindings/bindings_helper.h +2 -0
@@ -94,6 +94,7 @@#include <linux/tracepoint.h> #include <linux/usb.h> #include <linux/vfio.h> +#include <linux/vfio_pci_core.h> #include <linux/wait.h> #include <linux/workqueue.h> #include <linux/xarray.h>
@@ -117,6 +118,7 @@ const size_t RUST_CONST_HELPER_ARCH_SLAB_MINALIGN = ARCH_SLAB_MINALIGN;const size_t RUST_CONST_HELPER_ARCH_KMALLOC_MINALIGN =ARCH_KMALLOC_MINALIGN ;const size_t RUST_CONST_HELPER_PAGE_SIZE =PAGE_SIZE ;const unsigned int RUST_CONST_HELPER_VFIO_DEVICE_RESET =VFIO_DEVICE_RESET ; +const unsigned int RUST_CONST_HELPER_VFIO_DEVICE_PCI_HOT_RESET =VFIO_DEVICE_PCI_HOT_RESET ;const size_t RUST_CONST_HELPER_GENLMSG_DEFAULT_SIZE =GENLMSG_DEFAULT_SIZE ;const gfp_t RUST_CONST_HELPER_GFP_ATOMIC =GFP_ATOMIC ;const gfp_t RUST_CONST_HELPER_GFP_KERNEL =GFP_KERNEL ;
rust/kernel/pci.rs +12 -0
@@ -428,6 +428,18 @@ pub enum ErsResult { }impl ErsResult { +#[cfg_attr(not( CONFIG_VFIO_PCI_CORE = "y" ), expect(dead_code))] +pub (crate )fn from_raw (result: bindings::pci_ers_result_t ) ->Option <Self > { +match result { + bindings::pci_ers_result_PCI_ERS_RESULT_NONE =>Some (Self ::None ), + bindings::pci_ers_result_PCI_ERS_RESULT_CAN_RECOVER =>Some (Self ::CanRecover ), + bindings::pci_ers_result_PCI_ERS_RESULT_NEED_RESET =>Some (Self ::NeedReset ), + bindings::pci_ers_result_PCI_ERS_RESULT_DISCONNECT =>Some (Self ::Disconnect ), + bindings::pci_ers_result_PCI_ERS_RESULT_RECOVERED =>Some (Self ::Recovered ), + _ =>None , + } + } +fn as_raw (self) -> bindings::pci_ers_result_t {match self {Self ::None => bindings::pci_ers_result_PCI_ERS_RESULT_NONE,
rust/kernel/vfio.rs +16 -8
@@ -3,7 +3,12 @@//! Virtual Function I/O (VFIO) devices and callback data. //! //! `DeviceBase` combines a C VFIO device structure with the data its callbacks use. -//! [`Device`] is an alias of it for `struct vfio_device`. +//! [`Device`] and the bus-specific devices are aliases of it, such as +#." +)] +#![cfg_attr(not( CONFIG_VFIO_PCI_CORE = "y" ), doc = "`vfio::pci::Device`." )] //! //! C header: [`include/linux/vfio.h`](srctree/include/linux/vfio.h)
@@ -28,6 +33,9 @@ ptr::NonNull, // }; +#[cfg( CONFIG_VFIO_PCI_CORE = "y" )] +pub mod pci; +/// Reset the VFIO device. pub const DEVICE_RESET :u32 = bindings::VFIO_DEVICE_RESET ;
@@ -91,7 +99,7 @@ impl IoContext for GetRegionInfo {}/// The data the driver of a [`Device`] shares with its callbacks. /// -/// Bus-specific operations traits extend this trait. +/// Bus-specific operations traits, such as `vfio::pci::Operations`, extend this trait. pub trait Operations :Sized +Send +Sync + 'static {/// Data owned by the registration and passed to VFIO callbacks. ///
@@ -127,7 +135,7 @@ struct CallbackData<T: Operations> {/// `raw` is the first field, so the `vfio_device` at the beginning of `Raw` is also at the /// beginning of `Self`, as `vfio_alloc_device()` requires. /// -/// Use the alias [`Device`]. +/// Use the aliases [`Device`] and `vfio::pci::Device`. /// /// # Invariants ///
@@ -148,7 +156,7 @@ pub struct DeviceBase<Raw, T: Operations, Ctx: DeviceContext = Normal> {/// A VFIO device, wrapping `struct vfio_device`. pub type Device <T ,Ctx =Normal > =DeviceBase <bindings::vfio_device ,T ,Ctx >; -#[expect(dead_code)] +#[cfg_attr(not( CONFIG_VFIO_PCI_CORE = "y" ), expect(dead_code))] impl <Raw ,T :Operations ,Ctx :DeviceContext >DeviceBase <Raw ,T ,Ctx > {/// Initializes the Rust fields of a newly allocated device. ///
@@ -193,7 +201,7 @@ fn as_raw_vfio(&self) -> *mut bindings::vfio_device { } } -#[expect(dead_code)] +#[cfg_attr(not( CONFIG_VFIO_PCI_CORE = "y" ), expect(dead_code))] impl <Raw ,T :Operations >DeviceBase <Raw ,T > {/// Publishes the registration data passed to callbacks. ///
@@ -240,7 +248,7 @@ unsafe fn close(&self) { } } -#[expect(dead_code)] +#[cfg_attr(not( CONFIG_VFIO_PCI_CORE = "y" ), expect(dead_code))] impl <Raw ,T :Operations >DeviceBase <Raw ,T ,Open > {/// Creates the open data from the registration data. ///
@@ -284,7 +292,7 @@ unsafe fn open<'a, 'reg: 'a, I>( } } -#[expect(dead_code)] +#[cfg_attr(not( CONFIG_VFIO_PCI_CORE = "y" ), expect(dead_code))] impl <Raw ,T :Operations ,Ctx :IoContext >DeviceBase <Raw ,T ,Ctx > {/// Returns the registration data and the open data, for an I/O callback. ///
@@ -345,7 +353,7 @@ unsafe impl<Raw, T: Operations> Sync for DeviceBase<Raw, T> {}/// Capability buffer supplied by VFIO for a region-info callback. pub struct InfoCap <'a> { -#[expect(dead_code)] +#[cfg_attr(not( CONFIG_VFIO_PCI_CORE = "y" ), expect(dead_code))] raw: &'amut bindings::vfio_info_cap , }
rust/kernel/vfio/pci.rs new file +812 -0
812 lines not on this page · raw message
Signature · 1 line
2.43.7
PATCH v4 4/5 gpu: nova-core: publish typed SR-IOV PF APIs
In reply to Simon SongFrom: Zhi Wang <[email protected]>
Register NovaCoreVfApi as typed SR-IOV PF data once the GPU is initialized.
Enable and disable VFs through the sriov_enable() and sriov_disable() callbacks. The VF registration removes VFs before dropping its PF API data. Declare the registration before the GPU so its borrowed services remain valid through VF teardown.
Expose a VF-side handle that borrows these services for each operation. Return an owned instance on open and close it on drop while the VF remains bound.
--- 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 +++++++++++++++++++------ 4 files changed, 167 insertions(+), 42 deletions(-)
drivers/gpu/nova-core/driver.rs +33 -1
@@ -29,7 +29,8 @@ NovaCoreFwCtl, NovaCoreFwCtlData, // }, - gpu::Gpu, // + gpu::Gpu, + vgpu::vgpu_api::NovaCoreVfApi, // };/// Counter for generating unique auxiliary device IDs.
@@ -43,6 +44,10 @@ pub(crate) struct NovaCore<'bound> {/// Unregisters fwctl and drains its callbacks before GPU resources are dropped. #[uses('gpu: invariant)] _fwctl: fwctl::Registration<'gpu, NovaCoreFwCtl>, +#[allow(clippy::type_complexity)] +#[pin] +#[uses('gpu: invariant)] + _vf_registration: pci::VfRegistration<'gpu, ForLt!(NovaCoreVfApi<'_>)>,#[pin] #[uses('bar1)] pub(crate) gpu: Gpu<'bar>,
@@ -115,6 +120,10 @@ fn probe<'bound>(try_pin_init! (NovaCore { _: { +if pdev.is_virtfn () { +return Err (ENODEV ); + } + pdev.enable_device_mem ()?; pdev.set_master (); },
@@ -146,6 +155,12 @@ fn probe<'bound>(Ok (()) }), +// SAFETY: The registration is stored in `NovaCore`, this driver's bus device +// private data. + _vf_registration <- unsafe { + pci::VfRegistration::new(pdev, NovaCoreVfApi::new(pdev, gpu)) + }, +// SAFETY: `NovaCore` is dropped when the device is unbound; i.e. `mem::forget()` is // never called on it. _reg: unsafe {
@@ -177,4 +192,21 @@ fn probe<'bound>( }, }) } + +fn sriov_enable <'a>( + _dev: &'a pci::Device <Core <'_>>, + _this:Pin <&Self ::Data <'a>>, + token: pci::SriovEnable <'a>, + ) ->Result <pci::SriovEnabled <'a>> { + token.enable_all () + } + +fn sriov_disable <'a>( + _dev: &'a pci::Device <Core <'_>>, + _this:Pin <&Self ::Data <'a>>, + token: pci::SriovDisable <'a>, + ) ->Result { + token.disable (); +Ok (()) + } }
drivers/gpu/nova-core/nova_core.rs +2 -1
@@ -35,9 +35,10 @@use debugfs::DebugfsData ; -#[cfg( CONFIG_PCI_IOV )] pub use vgpu::vgpu_api::{NovaCoreVfApi , +NovaCoreVfApiHandle , +VgpuInstance ,VgpuTypeInfo ,// };
drivers/gpu/nova-core/vgpu.rs +0 -1
@@ -42,7 +42,6 @@mod hal;mod instance;mod scrubber; -#[cfg_attr(not( CONFIG_PCI_IOV ), expect(dead_code, unreachable_pub))] pub (crate )mod vgpu_api;mod vram;
drivers/gpu/nova-core/vgpu/vgpu_api.rs +132 -39
226 lines not on this page · raw message
Signature · 1 line
2.43.7
PATCH v4 5/5 vfio/nova-vgpu: add the Rust VFIO variant driver
In reply to Simon SongFrom: Danilo Krummrich <[email protected]>
NVIDIA vGPU VFs need nova-core to manage their instances when assigned to userspace through VFIO.
Add a Rust VFIO PCI variant driver that uses the typed SR-IOV PF APIs to create an instance on first open and close it on last close. Expose the assigned device and subsystem IDs, enforce the assigned BAR1 aperture, and reset the active vGPU instance on PCI reset.
Match the supported NVIDIA devices through VFIO override-only entries. Devices without an available Nova vGPU interface use ordinary PCI passthrough.
Register the VFIO device from probe and keep the Registration in the PCI driver data, so that unbind unregisters it. Extend the GPU build rules to make nova-core crate metadata available to the VFIO driver and export the Rust symbols it references.
--- drivers/gpu/Makefile | 15 +- 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 | 418 ++++++++++++++++++++++++ 6 files changed, 457 insertions(+), 3 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
drivers/gpu/Makefile +12 -3
@@ -19,8 +19,9 @@ nova-core-y := nova-core/nova_core.o nova-core/nova_core_exports.o obj-$(CONFIG_DRM_NOVA) += nova-drm.o nova-drm-y := drm/nova/nova.o -# Export Rust symbols from nova-core only if nova-drm actually references them. -nova-core-export-deps := $(if $(CONFIG_DRM_NOVA),$(obj)/drm/nova/nova.o) +# Export Rust symbols from nova-core only if dependent modules reference them. +nova-core-export-deps := $(if $(CONFIG_DRM_NOVA),$(obj)/drm/nova/nova.o) \ + $(if $(CONFIG_NOVA_VGPU_VFIO_PCI),$(obj)/../vfio/pci/nova-vgpu/nova_vgpu.o) rust_needed_exports = \ { $(if $(strip $(2)),$(NM) -u $(2);,) echo "__DEFINED_RUST_SYMBOLS__"; \
@@ -57,10 +58,18 @@ $(obj)/nova-core/nova_core_exports.o: private cmd_gensymtypes_c = \ $(obj)/nova-core/nova_core.o endif -# Output nova-core's crate metadata for use by nova-drm at compile time. +# Output nova-core's crate metadata for its Rust consumers at compile time. RUSTFLAGS_nova-core/nova_core.o += \ --emit=metadata=$(objtree)/$(obj)/nova-core/libnova_core.rmeta # Allow nova-drm to import nova-core's types. $(obj)/drm/nova/nova.o: $(obj)/nova-core/nova_core.o RUSTFLAGS_drm/nova/nova.o := -L $(objtree)/$(obj)/nova-core --extern nova_core + +# Build the NVIDIA VFIO driver here so metadata and generated exports share +# the same dependency graph as nova-drm. +obj-$(CONFIG_NOVA_VGPU_VFIO_PCI) += nova-vgpu-vfio-pci.o +nova-vgpu-vfio-pci-y := ../vfio/pci/nova-vgpu/nova_vgpu.o + +$(obj)/../vfio/pci/nova-vgpu/nova_vgpu.o: $(obj)/nova-core/nova_core.o +RUSTFLAGS_../vfio/pci/nova-vgpu/nova_vgpu.o := -L $(objtree)/$(obj)/nova-core --extern nova_core
drivers/vfio/pci/Kconfig +2 -0
@@ -74,4 +74,6 @@ source "drivers/vfio/pci/qat/Kconfig" source "drivers/vfio/pci/xe/Kconfig" +source "drivers/vfio/pci/nova-vgpu/Kconfig" + endmenu
drivers/vfio/pci/Makefile +2 -0
@@ -24,3 +24,5 @@ obj-$(CONFIG_NVGRACE_GPU_VFIO_PCI) += nvgrace-gpu/ obj-$(CONFIG_QAT_VFIO_PCI) += qat/ obj-$(CONFIG_XE_VFIO_PCI) += xe/ + +# nova-vgpu is built from drivers/gpu/Makefile for nova-core crate linkage.
drivers/vfio/pci/nova-vgpu/Kconfig new file +20 -0
@@ -0,0 +1,20 @@ +# 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=y + help + This option enables VFIO (Virtual Function I/O) support for + NVIDIA virtual GPUs (vGPU). It allows the assignment of a virtual + GPU instance to userspace applications via VFIO, typically used + with hypervisors such as KVM and device emulators like QEMU. + + Devices without an available Nova vGPU interface use ordinary PCI + passthrough. Both paths use the VFIO PCI core defaults; vfio-pci + module options do not apply. + + The NVIDIA vGPU allows a physical GPU to be partitioned into + multiple virtual GPUs, each of which can be passed to a virtual + machine as a PCI device using the standard VFIO infrastructure. + + If you don't know what to do here, say N.
drivers/vfio/pci/nova-vgpu/Makefile new file +3 -0
@@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0 +# nova-vgpu is built from drivers/gpu/Makefile for nova-core crate linkage. +# nova_vgpu.o (rust-analyzer marker - DO NOT REMOVE).
drivers/vfio/pci/nova-vgpu/nova_vgpu.rs new file +418 -0
418 lines not on this page · raw message
Signature · 1 line
2.43.7