mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/1] vfio/pci: Give drivers control of PCI driver_data
@ 2026-09-30 14:36 Simon Song
  2026-09-30 14:36 ` [PATCH v2 1/1] vfio/pci: Remove the core dependency on driver data Simon Song
  2026-09-30 15:32 ` [PATCH v2 0/1] vfio/pci: Give drivers control of PCI driver_data Simon Song
  0 siblings, 2 replies; 4+ messages in thread
From: Simon Song @ 2026-09-30 14:36 UTC (permalink / raw)
  To: alex, jgg
  Cc: dakr, acourbot, yishaih, skolothumtho, kevin.tian, jhubbard,
	ecourtney, cjia, smitra, kjaju, alkumar, ankita, aniketa,
	kwankhede, targupta, linux-kernel, kvm, zhiwang, zhiw,
	Simon Song

Hi All,

During the discussion of the proposed Rust NVIDIA vGPU VFIO variant
driver [1], Danilo mentioned that vfio-pci-core requires pci driver_data
to point to vfio_pci_core_device, this conflicts with driver data
managed by proposed nvidia vfio variant driver.

This patch moves the responsibility for interpreting driver_data to the
pci driver, the vfio core functions (PM, AER, VGA) takes an explicit
vfio_pci_core_device pointer and no longer depend on pci driver_data

VFIO_PCI_CORE_DEFINE_CALLBACK marcos generate the wrappers for existing
vfio variant drivers, each driver also assigns its own PM ops table to
replace the operation done by vfio-pci-core during registration.

For VGA, drivers provide its decode callback to
vfio_pci_core_register_device, VGA setup/teardown remains inside vfio
core registration/unregistration, this preserves vga initialize
sequence and also remove the core dependacy on driver data.


[1] https://lore.kernel.org/all/DLFD2ZDSK9YQ.3A4R66G8UJMD8@kernel.org/

Simon Song (1):
  vfio/pci: Remove the core dependency on driver data

 .../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              | 60 +++++++------------
 drivers/vfio/pci/virtio/main.c                |  8 ++-
 drivers/vfio/pci/xe/main.c                    |  8 ++-
 include/linux/vfio_pci_core.h                 | 42 ++++++++++++-
 12 files changed, 160 insertions(+), 94 deletions(-)

-- 
2.43.7


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

end of thread, other threads:[~2026-09-30 17:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-30 14:36 [PATCH v2 0/1] vfio/pci: Give drivers control of PCI driver_data Simon Song
2026-09-30 14:36 ` [PATCH v2 1/1] vfio/pci: Remove the core dependency on driver data Simon Song
2026-09-30 17:40   ` Danilo Krummrich
2026-09-30 15:32 ` [PATCH v2 0/1] vfio/pci: Give drivers control of PCI driver_data Simon Song

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®