vfio: Move iova_bitmap into iommufd
authorJoao Martins <joao.m.martins@oracle.com>
Tue, 24 Oct 2023 13:50:53 +0000 (14:50 +0100)
committerJason Gunthorpe <jgg@nvidia.com>
Tue, 24 Oct 2023 14:58:42 +0000 (11:58 -0300)
commit8c9c727b6142325ed5697240fceb99cbeb4ac2ec
treee77756c398f0eabeabb70a30ad0d94189922ca8b
parent53f0b020218fcc0a56a11df39630dbd379e4d9a6
vfio: Move iova_bitmap into iommufd

Both VFIO and IOMMUFD will need iova bitmap for storing dirties and walking
the user bitmaps, so move to the common dependency into IOMMUFD.  In doing
so, create the symbol IOMMUFD_DRIVER which designates the builtin code that
will be used by drivers when selected. Today this means MLX5_VFIO_PCI and
PDS_VFIO_PCI. IOMMU drivers will do the same (in future patches) when
supporting dirty tracking and select IOMMUFD_DRIVER accordingly.

Given that the symbol maybe be disabled, add header definitions in
iova_bitmap.h for when IOMMUFD_DRIVER=n

Link: https://lore.kernel.org/r/20231024135109.73787-3-joao.m.martins@oracle.com
Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Brett Creeley <brett.creeley@amd.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/iommu/Kconfig
drivers/iommu/iommufd/Makefile
drivers/iommu/iommufd/iova_bitmap.c [new file with mode: 0644]
drivers/vfio/Makefile
drivers/vfio/iova_bitmap.c [deleted file]
drivers/vfio/pci/mlx5/Kconfig
drivers/vfio/pci/pds/Kconfig
include/linux/iova_bitmap.h