rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Danilo Krummrich <dakr@kernel.org>
Cc: "John Hubbard" <jhubbard@nvidia.com>,
	"Alexandre Courbot" <acourbot@nvidia.com>,
	"Joel Fernandes" <joelagnelf@nvidia.com>,
	"Timur Tabi" <ttabi@nvidia.com>,
	"Alistair Popple" <apopple@nvidia.com>,
	"Zhi Wang" <zhiw@nvidia.com>, "Surath Mitra" <smitra@nvidia.com>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	"Alex Williamson" <alex.williamson@redhat.com>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	"Alex Gaynor" <alex.gaynor@gmail.com>,
	"Boqun Feng" <boqun.feng@gmail.com>,
	"Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Trevor Gross" <tmgross@umich.edu>,
	nouveau@lists.freedesktop.org, linux-pci@vger.kernel.org,
	rust-for-linux@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 1/2] rust: pci: skip probing VFs if driver doesn't support VFs
Date: Thu, 2 Oct 2025 14:05:06 -0300	[thread overview]
Message-ID: <20251002170506.GA3299207@nvidia.com> (raw)
In-Reply-To: <DD7YQK3PQIA1.15L4J6TTR9JFZ@kernel.org>

On Thu, Oct 02, 2025 at 06:05:28PM +0200, Danilo Krummrich wrote:
> On Thu Oct 2, 2025 at 5:23 PM CEST, Jason Gunthorpe wrote:
> > This is not what I've been told, the VF driver has significant
> > programming model differences in the NVIDIA model, and supports
> > different commands.
> 
> Ok, that means there are some more fundamental differences between the host PF
> and the "VM PF" code that we have to deal with.

That was my understanding.
 
> But that doesn't necessarily require that the VF parts of the host have to be in
> nova-core as well, i.e. with the information we have we can differentiate
> between PF, VF and PF in the VM (indicated by a device register).

I'm not entirely sure what you mean by this..

The driver to operate the function in "vGPU" mode as indicated by the
register has to be in nova-core, since there is only one device ID.

> > If you look at the VFIO driver RFC it basically does no mediation, it
> > isn't intercepting MMIO - the guest sees the BARs directly. Most of
> > the code is "profiling" from what I can tell. Some config space
> > meddling.
> 
> Sure, there is no mediation in that sense, but it needs quite some setup
> regardless, no?
>
> I thought there is a significant amount of semantics that is different between
> booting the PF and the VF on the host.

I think it would be good to have Zhi clarify more of this, but from
what I understand are at least three activites comingled all together:

 1) Boot the PF in "vGPU" mode so it can enable SRIOV
 2) Enable SRIOV and profile VFs to allocate HW resources to them
 3) VFIO variant driver to convert the VF into a "VM PF" with whatever
    mediation and enhancement needed

From a broad perspective we in the kernel have put #2 outside VFIO
because all of that is actually run through the PF and doesn't use the
VF at all.

#3 is the vfio driver and I would like it if vfio drivers restrained
themselves to focus on the mediation, live migration and things like
that which are directly related to VFIO..

> Also, the idea was to use a layered approach, i.e. let nova-core
> serve as an abstraction layer, where the DRM and VFIO parts can be
> layered on top of.

Yes, I think everyone is good with some version of this..

A big question in my mind is where do you put #2, and what uapi does
it provide. It has to layer on top of nova-core because it has to use
the PF to do profiling.

I'm not a fan of the vfio based sysfs as uAPI for #2, for reasons
touched on in this thread.

NIC drivers are using fwctl and devlink for profiling, managed by the
PF driver. I think I'd want to here reasons why those interfaces
cannot be used here.

Jason

  reply	other threads:[~2025-10-02 17:05 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-02  2:00 [PATCH v2 0/2] rust: pci: don't probe() VFs in nova-core John Hubbard
2025-10-02  2:00 ` [PATCH v2 1/2] rust: pci: skip probing VFs if driver doesn't support VFs John Hubbard
2025-10-02 11:49   ` Danilo Krummrich
2025-10-02 12:11   ` Jason Gunthorpe
2025-10-02 12:18     ` Danilo Krummrich
2025-10-02 12:39       ` Jason Gunthorpe
2025-10-02 13:03         ` Danilo Krummrich
2025-10-02 13:56           ` Jason Gunthorpe
2025-10-02 15:11             ` Danilo Krummrich
2025-10-02 15:23               ` Jason Gunthorpe
2025-10-02 16:05                 ` Danilo Krummrich
2025-10-02 17:05                   ` Jason Gunthorpe [this message]
2025-10-02 17:37                     ` Danilo Krummrich
2025-10-02 17:40                       ` Danilo Krummrich
2025-10-02 17:49                         ` John Hubbard
2025-10-02 18:05                           ` Jason Gunthorpe
2025-10-02 18:09                             ` John Hubbard
2025-10-02 18:32                               ` Jason Gunthorpe
2025-10-02 18:17                             ` Danilo Krummrich
2025-10-02 18:31                               ` Jason Gunthorpe
2025-10-02 18:42                                 ` Danilo Krummrich
2025-10-02 18:56                                   ` Jason Gunthorpe
2025-10-02 19:36                                     ` Danilo Krummrich
2025-10-02 21:04                                       ` Jason Gunthorpe
2025-10-02 21:14                                         ` Danilo Krummrich
2025-10-02 21:32                                           ` Danilo Krummrich
2025-10-02 23:40                                             ` Jason Gunthorpe
2025-10-03  0:57                                               ` Danilo Krummrich
2025-10-03 11:52                                                 ` Jason Gunthorpe
2025-10-02 17:56                       ` Jason Gunthorpe
2025-10-02 18:55                         ` Danilo Krummrich
2025-10-02  2:00 ` [PATCH v2 2/2] gpu: nova-core: declare that VFs are not (yet) supported John Hubbard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251002170506.GA3299207@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=a.hindborg@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=airlied@gmail.com \
    --cc=alex.gaynor@gmail.com \
    --cc=alex.williamson@redhat.com \
    --cc=aliceryhl@google.com \
    --cc=apopple@nvidia.com \
    --cc=bhelgaas@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=dakr@kernel.org \
    --cc=gary@garyguo.net \
    --cc=jhubbard@nvidia.com \
    --cc=joelagnelf@nvidia.com \
    --cc=kwilczynski@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=nouveau@lists.freedesktop.org \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=simona@ffwll.ch \
    --cc=smitra@nvidia.com \
    --cc=tmgross@umich.edu \
    --cc=ttabi@nvidia.com \
    --cc=zhiw@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).