NVIDIA GPU driver infrastructure
 help / color / mirror / Atom feed
* [PATCH v5 0/4] Rust VFIO PCI support
@ 2026-12-04  4:17 Simon Song
  2026-12-04  4:17 ` [PATCH v5 1/4] rust: uaccess: support bounded forward buffer traversal Simon Song
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Simon Song @ 2026-12-04  4:17 UTC (permalink / raw)
  To: dakr, acourbot, kvm, rust-for-linux, nova-gpu, linux-pci
  Cc: Simon Song, alex, jgg, yishaih, skolothumtho, kevin.tian, airlied,
	simona, ojeda, alex.gaynor, boqun.feng, gary, bjorn3_gh, lossin,
	a.hindborg, aliceryhl, tmgross, jhubbard, ecourtney, cjia, smitra,
	kjaju, alkumar, ankita, aniketa, kwankhede, targupta,
	linux-kernel, zhiwang, zhiw, boqun, daniel.almeida, tamird, work,
	jgg, bhelgaas, kwilczynski, dri-devel, peter, Liam R. Howlett,
	linux-mm, Lorenzo Stoakes

This is v5 of the Rust VFIO PCI abstractions. v4 was posted as "Rust
VFIO PCI support and NVIDIA vGPU driver" [1].

Up to v4 this series also carried the nova-core SR-IOV PF interface and
the NVIDIA VFIO variant driver. Those two patches depend on Alok's vGPU
manager series [2], so the series did not apply to a public tree and
Sashiko could not review it. They will now be posted as a separate
series on top of this one. The four patches here have no external
dependencies and are based on drm-rust-next.

Patch 1 adds UserSlice helpers for bounded forward traversal. Patch 2
adds the VFIO device handling common to all buses. Patch 3 adds two
VmaRef accessors for patch 4, the VFIO PCI abstractions.

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 v4 [1]:
- Move the nova-core and nova-vgpu patches (v4 patches 4 and 5) to a
  separate series (Gary, Danilo).
- New patch 1: add UserSlice helpers for bounded forward traversal
  (Danilo).
- Patch 2 (v4 patch 1):
  - Remove UserBuf. The callbacks use UserSlice (Gary, Danilo).
  - Make InfoCap a transparent wrapper of struct vfio_info_cap (Gary).
  - Use 'res for the resource lifetime and 'reg for the registration
    lifetime (Gary, Danilo).
  - Do not name the hidden DeviceBase in the public documentation
    (Gary).
  - Use one module-level dead_code expectation (Gary).
  - Add #[inline] to the small DeviceBase accessors.
- Patch 3 (v4 patch 2): add Alice's Acked-by.
- Patch 4 (v4 patch 3):
  - Let Registration::new() allocate the VFIO device, and remove the
    public allocator (Gary, Danilo).
  - Give the Open context of open_device() its own lifetime, so that
    the open data cannot retain it (Gary).
  - Pass a UserSlice to read() and write() (Gary, Danilo).
  - Wrap struct vfio_region_info in RegionInfo (Gary).
  - Remove the unused DEVICE_PCI_HOT_RESET (Gary).
  - Assert that the device alignment fits the vmalloc fallback of
    kvzalloc() (Gary).
  - Check the bound driver at runtime in Registration::new() instead
    of the const assertions on the driver type, and add
    pci::Device::driver_has_managed_dma() and
    pci::Device::driver_has_sriov_configure() for that (Gary, Danilo).
  - Add #[inline] to the small Position, Mapping and Device helpers.

v4 patches 1, 2 and 3 are now patches 2, 3 and 4.

[1] https://lore.kernel.org/r/20261127224928.1511382-1-xinmengs@nvidia.com
[2] https://lore.kernel.org/all/cover.1796191007.git.alkumar@nvidia.com/
[3] https://lore.kernel.org/r/20261124113555.2480381-1-beata.michalska@arm.com

Danilo Krummrich (1):
  rust: vfio: add PCI variant driver abstractions

Simon Song (2):
  rust: uaccess: support bounded forward buffer traversal
  rust: mm: add VmaRef::size() and VmaRef::pgoff()

Zhi Wang (1):
  rust: vfio: add common VFIO device handling

 rust/bindings/bindings_helper.h |   3 +
 rust/kernel/lib.rs              |   2 +
 rust/kernel/mm/virt.rs          |  14 +
 rust/kernel/pci.rs              |  39 ++
 rust/kernel/uaccess.rs          |  44 +-
 rust/kernel/vfio.rs             | 366 +++++++++++++
 rust/kernel/vfio/pci.rs         | 880 ++++++++++++++++++++++++++++++++
 7 files changed, 1346 insertions(+), 2 deletions(-)
 create mode 100644 rust/kernel/vfio.rs
 create mode 100644 rust/kernel/vfio/pci.rs


base-commit: d9da44362d77bcbf1f5bfd2ba1c514e776fdb07c
-- 
2.43.7


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-12-05  4:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04  4:17 [PATCH v5 0/4] Rust VFIO PCI support Simon Song
2026-12-04  4:17 ` [PATCH v5 1/4] rust: uaccess: support bounded forward buffer traversal Simon Song
2026-12-04  4:17 ` [PATCH v5 2/4] rust: vfio: add common VFIO device handling Simon Song
2026-12-05  4:19   ` sashiko-bot
2026-12-04  4:17 ` [PATCH v5 3/4] rust: mm: add VmaRef::size() and VmaRef::pgoff() Simon Song
2026-12-04  4:17 ` [PATCH v5 4/4] rust: vfio: add PCI variant driver abstractions Simon Song
2026-12-05  4:19   ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox