rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] rust: pci: expose is_virtfn() and reject VFs in nova-core
@ 2025-09-30 22:07 John Hubbard
  2025-09-30 22:07 ` [PATCH 1/2] rust: pci: add is_virtfn(), to check for VFs John Hubbard
                   ` (3 more replies)
  0 siblings, 4 replies; 46+ messages in thread
From: John Hubbard @ 2025-09-30 22:07 UTC (permalink / raw)
  To: Danilo Krummrich
  Cc: Alexandre Courbot, Joel Fernandes, Timur Tabi, Alistair Popple,
	Zhi Wang, Surath Mitra, David Airlie, Simona Vetter,
	Bjorn Helgaas, Krzysztof Wilczyński, Miguel Ojeda,
	Alex Gaynor, Boqun Feng, Gary Guo, Björn Roy Baron,
	Benno Lossin, Andreas Hindborg, Alice Ryhl, Trevor Gross, nouveau,
	linux-pci, rust-for-linux, LKML, John Hubbard

Post-Kangrejos, the approach for NovaCore + VFIO has changed a bit: the
idea now is that VFIO drivers, for NVIDIA GPUs that are supported by
NovaCore, should bind directly to the GPU's VFs. (An earlier idea was to
let NovaCore bind to the VFs, and then have NovaCore call into the upper
(VFIO) module via Aux Bus, but this turns out to be awkward and is no
longer in favor.) So, in order to support that:

Nova-core must only bind to Physical Functions (PFs) and regular PCI
devices, not to Virtual Functions (VFs) created through SR-IOV.

Add a method to check if a PCI device is a Virtual Function (VF). This
allows Rust drivers to determine whether a device is a VF created
through SR-IOV. This is required in order to implement VFIO, because
drivers such as NovaCore must only bind to Physical Functions (PFs) or
regular PCI devices. The VFs must be left unclaimed, so that a VFIO
kernel module can claim them.

Use is_virtfn() in NovaCore, in preparation for it to be used in a VFIO
scenario.

I've based this on top of today's driver-core-next [1], because the
first patch belongs there, and the second patch applies cleanly to either
driver-core-next or drm-rust-next. So this seems like the easiest to
work with.


[1] https://git.kernel.org/pub/scm/linux/kernel/git/driver-core/driver-core.git/

John Hubbard (2):
  rust: pci: add is_virtfn(), to check for VFs
  gpu: nova-core: reject binding to SR-IOV Virtual Functions

 drivers/gpu/nova-core/driver.rs | 5 +++++
 rust/kernel/pci.rs              | 6 ++++++
 2 files changed, 11 insertions(+)


base-commit: 6d97171ac6585de698df019b0bfea3f123fd8385
-- 
2.51.0


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

end of thread, other threads:[~2025-10-07 11:26 UTC | newest]

Thread overview: 46+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-30 22:07 [PATCH 0/2] rust: pci: expose is_virtfn() and reject VFs in nova-core John Hubbard
2025-09-30 22:07 ` [PATCH 1/2] rust: pci: add is_virtfn(), to check for VFs John Hubbard
2025-10-01  0:30   ` Alistair Popple
2025-09-30 22:07 ` [PATCH 2/2] gpu: nova-core: reject binding to SR-IOV Virtual Functions John Hubbard
2025-10-01  0:33   ` Alistair Popple
2025-10-01  1:26     ` John Hubbard
2025-10-01  0:26 ` [PATCH 0/2] rust: pci: expose is_virtfn() and reject VFs in nova-core Alexandre Courbot
2025-10-01  1:26   ` John Hubbard
2025-10-01  1:39     ` Alexandre Courbot
2025-10-01  1:45       ` John Hubbard
2025-10-01  8:09         ` Zhi Wang
2025-10-01 14:48           ` Jason Gunthorpe
2025-10-01 21:13             ` Zhi Wang
2025-10-02  1:43               ` Alexandre Courbot
2025-10-02  1:50                 ` John Hubbard
2025-10-02 11:58               ` Jason Gunthorpe
2025-10-02 12:59                 ` Zhi Wang
2025-10-02 13:42                   ` Jason Gunthorpe
2025-10-02 14:29                     ` Zhi Wang
2025-10-02 14:31                       ` Jason Gunthorpe
2025-10-07  6:51                         ` Zhi Wang
2025-10-07 10:14                           ` Danilo Krummrich
2025-10-07 11:00                             ` Zhi Wang
2025-10-07 11:26                           ` Jason Gunthorpe
2025-10-01 14:46     ` Jason Gunthorpe
2025-10-01 18:16       ` Alex Williamson
2025-10-01 18:30         ` Jason Gunthorpe
2025-10-01 22:35           ` John Hubbard
2025-10-02  7:41   ` Zhi Wang
2025-10-01  0:29 ` Alistair Popple
2025-10-01  1:22   ` John Hubbard
2025-10-01 10:32     ` Danilo Krummrich
2025-10-01 13:52       ` Zhi Wang
2025-10-01 22:38         ` John Hubbard
2025-10-01 22:52           ` Danilo Krummrich
2025-10-01 23:00             ` John Hubbard
2025-10-01 23:47               ` Joel Fernandes
2025-10-01 23:51                 ` John Hubbard
2025-10-01 23:55                   ` Danilo Krummrich
2025-10-02  0:48                     ` Joel Fernandes
2025-10-02  0:54                       ` John Hubbard
2025-10-02 12:05                         ` Jason Gunthorpe
2025-10-02 12:01             ` Jason Gunthorpe
2025-10-02 12:08               ` Danilo Krummrich
2025-10-02 12:32                 ` Jason Gunthorpe
2025-10-02 12:41                   ` Danilo Krummrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).