OSDN Git Service

vfio/pci: Split the pci_driver code out of vfio_pci_core.c
authorMax Gurtovoy <mgurtovoy@nvidia.com>
Thu, 26 Aug 2021 10:39:05 +0000 (13:39 +0300)
committerAlex Williamson <alex.williamson@redhat.com>
Thu, 26 Aug 2021 16:36:51 +0000 (10:36 -0600)
commitff53edf6d6ab0970f86595b3f5d179df51848723
treed9494b4f9a4629c304a28d361c97268afb4a44ec
parentc39f8fa76cdd0c96f82fa785a0d6c92afe8f4a77
vfio/pci: Split the pci_driver code out of vfio_pci_core.c

Split the vfio_pci driver into two logical parts, the 'struct
pci_driver' (vfio_pci.c) which implements "Generic VFIO support for any
PCI device" and a library of code (vfio_pci_core.c) that helps
implementing a struct vfio_device on top of a PCI device.

vfio_pci.ko continues to present the same interface under sysfs and this
change should have no functional impact.

Following patches will turn vfio_pci and vfio_pci_core into a separate
module.

This is a preparation for allowing another module to provide the
pci_driver and allow that module to customize how VFIO is setup, inject
its own operations, and easily extend vendor specific functionality.

At this point the vfio_pci_core still contains a lot of vfio_pci
functionality mixed into it. Following patches will move more of the
large scale items out, but another cleanup series will be needed to get
everything.

Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
Link: https://lore.kernel.org/r/20210826103912.128972-7-yishaih@nvidia.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/pci/Makefile
drivers/vfio/pci/vfio_pci.c [new file with mode: 0644]
drivers/vfio/pci/vfio_pci_core.c
drivers/vfio/pci/vfio_pci_core.h