[PATCH 2/2] gpu: nova-core: reject binding to SR-IOV Virtual Functions
From: John Hubbard
Date: Tue Sep 30 2025 - 18:08:11 EST
Nova-core must only bind to Physical Functions (PFs) and regular PCI
devices, not to Virtual Functions (VFs) created through SR-IOV.
Detect VFs using the newly added is_virtfn() method, and leave them
unclaimed. This allows a VFIO kernel module to claim the VFs instead.
Signed-off-by: John Hubbard <jhubbard@xxxxxxxxxx>
---
drivers/gpu/nova-core/driver.rs | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/gpu/nova-core/driver.rs b/drivers/gpu/nova-core/driver.rs
index 5d23a91f51dd..004c15763694 100644
--- a/drivers/gpu/nova-core/driver.rs
+++ b/drivers/gpu/nova-core/driver.rs
@@ -54,6 +54,11 @@ impl pci::Driver for NovaCore {
fn probe(pdev: &pci::Device<Core>, _info: &Self::IdInfo) -> Result<Pin<KBox<Self>>> {
dev_dbg!(pdev.as_ref(), "Probe Nova Core GPU driver.\n");
+ // NovaCore must only bind to Physical Functions (PFs), not Virtual Functions (VFs)
+ if pdev.is_virtfn() {
+ return Err(ENODEV);
+ }
+
pdev.enable_device_mem()?;
pdev.set_master();
--
2.51.0