All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Simon Song <xinmengs@nvidia.com>
Cc: alex@shazbot.org, dakr@kernel.org, acourbot@nvidia.com,
	yishaih@nvidia.com, skolothumtho@nvidia.com,
	kevin.tian@intel.com, jhubbard@nvidia.com, ecourtney@nvidia.com,
	cjia@nvidia.com, smitra@nvidia.com, kjaju@nvidia.com,
	alkumar@nvidia.com, ankita@nvidia.com, aniketa@nvidia.com,
	kwankhede@nvidia.com, targupta@nvidia.com,
	linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
	zhiwang@kernel.org, zhiw@nvidia.com,
	Alex Williamson <alex.williamson@nvidia.com>
Subject: Re: [PATCH v3 1/1] vfio/pci: Remove the core dependency on driver data
Date: Fri, 9 Oct 2026 16:28:00 -0300	[thread overview]
Message-ID: <20261009192800.GG13920@nvidia.com> (raw)
In-Reply-To: <20261005184236.1946167-2-xinmengs@nvidia.com>

On Mon, Oct 05, 2026 at 11:42:36AM -0700, Simon Song wrote:
> vfio-pci-core currently has runtime functions that interpret pci
> driver_data as a pointer to vfio_pci_core_device, and enforce vfio
> variant drivers must set vfio_pci_core_device to their pci driver_data.
> This constrains variant drivers' private-data layout, including the
> typed driver data used by the Rust PCI infrastructure.
> 
> Add VFIO_PCI_CORE_DEFINE_CALLBACKS marcos to generate wrapper code for
> each vfio variant driver, update vfio variant drivers to store their
> private strctures in driver_data and use generated wrapper to pass the
> vfio core device to helpers.
> 
> Select the vga decode callback during vfio_pci_vga_init based on if
> vfio_vga_disabled, the callback only use pci_dev and does not require
> driver_data
> 
> Assisted-by: LLM
> Suggested-by: Jason Gunthorpe <jgg@nvidia.com>
> Suggested-by: Alex Williamson <alex.williamson@nvidia.com>
> Suggested-by: Danilo Krummrich <dakr@kernel.org>
> Link: https://lore.kernel.org/all/DLFD2ZDSK9YQ.3A4R66G8UJMD8@kernel.org/
> Signed-off-by: Simon Song <xinmengs@nvidia.com>
> ---
>  .../vfio/pci/hisilicon/hisi_acc_vfio_pci.c    | 27 ++++----
>  drivers/vfio/pci/ism/main.c                   | 19 +++---
>  drivers/vfio/pci/mlx5/main.c                  | 13 ++--
>  drivers/vfio/pci/nvgrace-gpu/main.c           | 19 +++---
>  drivers/vfio/pci/pds/pci_drv.c                |  8 ++-
>  drivers/vfio/pci/pds/vfio_dev.c               |  5 +-
>  drivers/vfio/pci/qat/main.c                   | 12 ++--
>  drivers/vfio/pci/vfio_pci.c                   | 33 +++++++++-
>  drivers/vfio/pci/vfio_pci_core.c              | 61 +++++++------------
>  drivers/vfio/pci/virtio/main.c                |  8 ++-
>  drivers/vfio/pci/xe/main.c                    |  8 ++-
>  include/linux/vfio_pci_core.h                 | 41 ++++++++++++-
>  12 files changed, 159 insertions(+), 95 deletions(-)

This looks OK to me, but it probably should have been 3 patches,
mixing the VGA stuff into all of this (and you have a smart approach)
is not how upstream likes to see things arranged.

Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>

Jason

  parent reply	other threads:[~2026-10-09 19:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-05 18:42 [PATCH v3 0/1] vfio/pci: Give drivers control of PCI driver_data Simon Song
2026-10-05 18:42 ` [PATCH v3 1/1] vfio/pci: Remove the core dependency on driver data Simon Song
2026-10-05 19:21   ` Danilo Krummrich
2026-10-09 19:28   ` Jason Gunthorpe [this message]
2026-10-09 21:18     ` Alex Williamson
2026-10-10 10:41       ` Danilo Krummrich
2026-10-10 19:48 ` [PATCH v3 0/1] vfio/pci: Give drivers control of PCI driver_data Alex Williamson

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=20261009192800.GG13920@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=acourbot@nvidia.com \
    --cc=alex.williamson@nvidia.com \
    --cc=alex@shazbot.org \
    --cc=alkumar@nvidia.com \
    --cc=aniketa@nvidia.com \
    --cc=ankita@nvidia.com \
    --cc=cjia@nvidia.com \
    --cc=dakr@kernel.org \
    --cc=ecourtney@nvidia.com \
    --cc=jhubbard@nvidia.com \
    --cc=kevin.tian@intel.com \
    --cc=kjaju@nvidia.com \
    --cc=kvm@vger.kernel.org \
    --cc=kwankhede@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=skolothumtho@nvidia.com \
    --cc=smitra@nvidia.com \
    --cc=targupta@nvidia.com \
    --cc=xinmengs@nvidia.com \
    --cc=yishaih@nvidia.com \
    --cc=zhiw@nvidia.com \
    --cc=zhiwang@kernel.org \
    /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 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.