All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/14] Add Rust PCI SR-IOV support
@ 2026-09-15 20:56 Zhi Wang
  2026-09-15 20:56 ` [PATCH 01/14] PCI: add driver flag to opt into disabling SR-IOV on remove() Zhi Wang
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: Zhi Wang @ 2026-09-15 20:56 UTC (permalink / raw)
  To: dakr, acourbot
  Cc: 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, nova-gpu,
	linux-kernel, rust-for-linux, zhiwang, Zhi Wang

Rust PCI drivers need to enable and disable SR-IOV and share selected
PF-owned functionality with their VF drivers. The shared data must remain
valid while a VF driver is bound, including when the VF driver is in C.

This series builds on Peter Colberg's Rust PCI SR-IOV v3 series [1],
extending it with typed PF registration data and C FFI support. The
registration design follows Danilo Krummrich's Rust vGPU/VFIO PoC [2].
As the discussion on Rust/VFIO support is still ongoing [3], this series
supports both C and Rust sample VF drivers.

Add the PCI SR-IOV operations and callback, managed VF removal during PF
unbind, and typed PF registration data. A pinned registration publishes
the PF payload. Rust VFs borrow the typed data directly; C VFs use an
ABI-checked descriptor and generated C-to-Rust trampolines.

Include Rust and C VF samples and integrate the registration into
nova-core. Nova implements sriov_configure() and publishes PF-readiness
data before VFs are enabled. Document the sharing interface, its borrow
lifetimes and teardown ordering.

[1] https://lore.kernel.org/rust-for-linux/20260303-rust-pci-sriov-v3-0-4443c35f0c88@redhat.com/
[2] https://lore.kernel.org/nova-gpu/DLCRZLO06SIO.LS7TWQXIPZSQ@kernel.org/
[3] https://lore.kernel.org/nova-gpu/20260914121217.70fa0d93@shazbot.org/

John Hubbard (1):
  rust: pci: add is_virtfn(), to check for VFs

Peter Colberg (7):
  PCI: add driver flag to opt into disabling SR-IOV on remove()
  rust: pci: add {enable,disable}_sriov(), to control SR-IOV capability
  rust: pci: add vtable attribute to pci::Driver trait
  rust: pci: add bus callback sriov_configure(), to control SR-IOV from
    sysfs
  rust: pci: add is_physfn(), to check for PFs
  rust: pci: add num_vf(), to return number of VFs
  samples: rust: add Rust SR-IOV VF driver sample

Zhi Wang (6):
  rust: pci: add typed SR-IOV PF registration data
  rust: add C-to-Rust FFI descriptors and trampolines
  rust: pci: add C FFI support to typed SR-IOV PF registration data
  samples: rust: add C SR-IOV VF driver that calls into a Rust PF driver
  gpu: nova-core: publish typed SR-IOV PF data for VF drivers
  Documentation: rust: explain SR-IOV PF data sharing with VFs

 Documentation/rust/index.rst             |   1 +
 Documentation/rust/pci-sriov-pf-data.rst | 330 +++++++++++++++++++++
 MAINTAINERS                              |   4 +
 drivers/gpu/nova-core/driver.rs          |  34 ++-
 drivers/pci/iov.c                        | 103 ++++++-
 drivers/pci/pci-driver.c                 |   3 +-
 drivers/pci/pci.h                        |   2 +
 include/linux/pci.h                      |  44 +++
 include/linux/rust_ffi.h                 |  88 ++++++
 rust/bindings/bindings_helper.h          |   5 +
 rust/kernel/interop.rs                   |   5 +-
 rust/kernel/interop/ffi.rs               | 252 ++++++++++++++++
 rust/kernel/pci.rs                       | 126 ++++++++
 rust/kernel/pci/sriov.rs                 | 355 +++++++++++++++++++++++
 rust/macros/ffi_vtable.rs                | 148 ++++++++++
 rust/macros/lib.rs                       |  90 ++++++
 samples/rust/Kconfig                     |  26 ++
 samples/rust/Makefile                    |   2 +
 samples/rust/rust_dma.rs                 |   1 +
 samples/rust/rust_driver_auxiliary.rs    |   1 +
 samples/rust/rust_driver_pci.rs          |   1 +
 samples/rust/rust_driver_sriov.h         |  27 ++
 samples/rust/rust_driver_sriov.rs        | 270 +++++++++++++++++
 samples/rust/rust_driver_sriov_c_vf.c    |  61 ++++
 24 files changed, 1972 insertions(+), 7 deletions(-)
 create mode 100644 Documentation/rust/pci-sriov-pf-data.rst
 create mode 100644 include/linux/rust_ffi.h
 create mode 100644 rust/kernel/interop/ffi.rs
 create mode 100644 rust/kernel/pci/sriov.rs
 create mode 100644 rust/macros/ffi_vtable.rs
 create mode 100644 samples/rust/rust_driver_sriov.h
 create mode 100644 samples/rust/rust_driver_sriov.rs
 create mode 100644 samples/rust/rust_driver_sriov_c_vf.c


base-commit: 34a8ecc902e907d7b0596a8d38b437e90eac0701

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

end of thread, other threads:[~2026-09-16 11:10 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-15 20:56 [PATCH 00/14] Add Rust PCI SR-IOV support Zhi Wang
2026-09-15 20:56 ` [PATCH 01/14] PCI: add driver flag to opt into disabling SR-IOV on remove() Zhi Wang
2026-09-15 20:56 ` [PATCH 02/14] rust: pci: add {enable,disable}_sriov(), to control SR-IOV capability Zhi Wang
2026-09-15 20:56 ` [PATCH 03/14] rust: pci: add vtable attribute to pci::Driver trait Zhi Wang
2026-09-15 20:56 ` [PATCH 04/14] rust: pci: add bus callback sriov_configure(), to control SR-IOV from sysfs Zhi Wang
2026-09-15 20:56 ` [PATCH 05/14] rust: pci: add is_virtfn(), to check for VFs Zhi Wang
2026-09-15 20:56 ` [PATCH 06/14] rust: pci: add is_physfn(), to check for PFs Zhi Wang
2026-09-15 20:56 ` [PATCH 07/14] rust: pci: add num_vf(), to return number of VFs Zhi Wang
2026-09-15 20:56 ` [PATCH 08/14] rust: pci: add typed SR-IOV PF registration data Zhi Wang
2026-09-15 20:56 ` [PATCH 09/14] samples: rust: add Rust SR-IOV VF driver sample Zhi Wang
2026-09-15 20:56 ` [PATCH 10/14] rust: add C-to-Rust FFI descriptors and trampolines Zhi Wang
2026-09-15 20:56 ` [PATCH 11/14] rust: pci: add C FFI support to typed SR-IOV PF registration data Zhi Wang
2026-09-15 20:56 ` [PATCH 12/14] samples: rust: add C SR-IOV VF driver that calls into a Rust PF driver Zhi Wang
2026-09-15 20:56 ` [PATCH 13/14] gpu: nova-core: publish typed SR-IOV PF data for VF drivers Zhi Wang
2026-09-15 20:56 ` [PATCH 14/14] Documentation: rust: explain SR-IOV PF data sharing with VFs Zhi Wang
2026-09-16 11:10 ` [PATCH 00/14] Add Rust PCI SR-IOV support Danilo Krummrich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.