[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d2yft352u4p5goqqekbpngqyv4k5bopaof5xm75zg3npbobny2@73ojw73msjl4>
Date: Wed, 1 Oct 2025 10:33:19 +1000
From: Alistair Popple <apopple@...dia.com>
To: John Hubbard <jhubbard@...dia.com>
Cc: Danilo Krummrich <dakr@...nel.org>,
Alexandre Courbot <acourbot@...dia.com>, Joel Fernandes <joelagnelf@...dia.com>,
Timur Tabi <ttabi@...dia.com>, Zhi Wang <zhiw@...dia.com>, Surath Mitra <smitra@...dia.com>,
David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>,
Bjorn Helgaas <bhelgaas@...gle.com>, Krzysztof Wilczyński <kwilczynski@...nel.org>,
Miguel Ojeda <ojeda@...nel.org>, Alex Gaynor <alex.gaynor@...il.com>,
Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>, Benno Lossin <lossin@...nel.org>,
Andreas Hindborg <a.hindborg@...nel.org>, Alice Ryhl <aliceryhl@...gle.com>,
Trevor Gross <tmgross@...ch.edu>, nouveau@...ts.freedesktop.org, linux-pci@...r.kernel.org,
rust-for-linux@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] gpu: nova-core: reject binding to SR-IOV Virtual
Functions
On 2025-10-01 at 08:07 +1000, John Hubbard <jhubbard@...dia.com> wrote...
> 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.
See my comments on the cover letter, but does the kernel driver core continue
trying to probe other drivers if this one failed? Or does it just give up? If it
just gives up I'm not sure this really helps much, although I suppose if
NovaCore can't use the VFs for anything useful anyway then it probably should
fail.
> Signed-off-by: John Hubbard <jhubbard@...dia.com>
> ---
> 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
>
Powered by blists - more mailing lists