Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 71be3423 authored by Alex Williamson's avatar Alex Williamson
Browse files

vfio: Split virqfd into a separate module for vfio bus drivers



An unintended consequence of commit 42ac9bd1 ("vfio: initialize
the virqfd workqueue in VFIO generic code") is that the vfio module
is renamed to vfio_core so that it can include both vfio and virqfd.
That's a user visible change that may break module loading scritps
and it imposes eventfd support as a dependency on the core vfio code,
which it's really not.  virqfd is intended to be provided as a service
to vfio bus drivers, so instead of wrapping it into vfio.ko, we can
make it a stand-alone module toggled by vfio bus drivers.  This has
the additional benefit of removing initialization and exit from the
core vfio code.

Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
parent 66fdc052
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -13,6 +13,11 @@ config VFIO_SPAPR_EEH
	depends on EEH && VFIO_IOMMU_SPAPR_TCE
	default n

config VFIO_VIRQFD
	tristate
	depends on VFIO && EVENTFD
	default n

menuconfig VFIO
	tristate "VFIO Non-Privileged userspace driver framework"
	depends on IOMMU_API
+3 −2
Original line number Diff line number Diff line
vfio_core-y := vfio.o virqfd.o
vfio_virqfd-y := virqfd.o

obj-$(CONFIG_VFIO) += vfio_core.o
obj-$(CONFIG_VFIO) += vfio.o
obj-$(CONFIG_VFIO_VIRQFD) += vfio_virqfd.o
obj-$(CONFIG_VFIO_IOMMU_TYPE1) += vfio_iommu_type1.o
obj-$(CONFIG_VFIO_IOMMU_SPAPR_TCE) += vfio_iommu_spapr_tce.o
obj-$(CONFIG_VFIO_SPAPR_EEH) += vfio_spapr_eeh.o
+1 −0
Original line number Diff line number Diff line
config VFIO_PCI
	tristate "VFIO support for PCI devices"
	depends on VFIO && PCI && EVENTFD
	select VFIO_VIRQFD
	help
	  Support for the PCI VFIO bus driver.  This is required to make
	  use of PCI drivers using the VFIO framework.
+1 −0
Original line number Diff line number Diff line
config VFIO_PLATFORM
	tristate "VFIO support for platform devices"
	depends on VFIO && EVENTFD && ARM
	select VFIO_VIRQFD
	help
	  Support for platform devices with VFIO. This is required to make
	  use of platform devices present on the system using the VFIO
+0 −8
Original line number Diff line number Diff line
@@ -1552,11 +1552,6 @@ static int __init vfio_init(void)
	if (ret)
		goto err_cdev_add;

	/* Start the virqfd cleanup handler used by some VFIO bus drivers */
	ret = vfio_virqfd_init();
	if (ret)
		goto err_virqfd;

	pr_info(DRIVER_DESC " version: " DRIVER_VERSION "\n");

	/*
@@ -1569,8 +1564,6 @@ static int __init vfio_init(void)

	return 0;

err_virqfd:
	cdev_del(&vfio.group_cdev);
err_cdev_add:
	unregister_chrdev_region(vfio.group_devt, MINORMASK);
err_alloc_chrdev:
@@ -1585,7 +1578,6 @@ static void __exit vfio_cleanup(void)
{
	WARN_ON(!list_empty(&vfio.group_list));

	vfio_virqfd_exit();
	idr_destroy(&vfio.group_idr);
	cdev_del(&vfio.group_cdev);
	unregister_chrdev_region(vfio.group_devt, MINORMASK);
Loading