diff options
-rw-r--r-- | drivers/vfio/Makefile | 4 | ||||
-rw-r--r-- | drivers/vfio/pci/Makefile | 3 | ||||
-rw-r--r-- | drivers/vfio/pci/vfio_pci.c | 8 | ||||
-rw-r--r-- | drivers/vfio/vfio.c | 8 |
4 files changed, 12 insertions, 11 deletions
diff --git a/drivers/vfio/Makefile b/drivers/vfio/Makefile index dadf0ca146ef..d798b0959603 100644 --- a/drivers/vfio/Makefile +++ b/drivers/vfio/Makefile | |||
@@ -1,4 +1,6 @@ | |||
1 | obj-$(CONFIG_VFIO) += vfio.o | 1 | vfio_core-y := vfio.o virqfd.o |
2 | |||
3 | obj-$(CONFIG_VFIO) += vfio_core.o | ||
2 | obj-$(CONFIG_VFIO_IOMMU_TYPE1) += vfio_iommu_type1.o | 4 | obj-$(CONFIG_VFIO_IOMMU_TYPE1) += vfio_iommu_type1.o |
3 | obj-$(CONFIG_VFIO_IOMMU_SPAPR_TCE) += vfio_iommu_spapr_tce.o | 5 | obj-$(CONFIG_VFIO_IOMMU_SPAPR_TCE) += vfio_iommu_spapr_tce.o |
4 | obj-$(CONFIG_VFIO_SPAPR_EEH) += vfio_spapr_eeh.o | 6 | obj-$(CONFIG_VFIO_SPAPR_EEH) += vfio_spapr_eeh.o |
diff --git a/drivers/vfio/pci/Makefile b/drivers/vfio/pci/Makefile index c7c864436896..131079255fd9 100644 --- a/drivers/vfio/pci/Makefile +++ b/drivers/vfio/pci/Makefile | |||
@@ -1,5 +1,4 @@ | |||
1 | 1 | ||
2 | vfio-pci-y := vfio_pci.o vfio_pci_intrs.o vfio_pci_rdwr.o vfio_pci_config.o \ | 2 | vfio-pci-y := vfio_pci.o vfio_pci_intrs.o vfio_pci_rdwr.o vfio_pci_config.o |
3 | ../virqfd.o | ||
4 | 3 | ||
5 | obj-$(CONFIG_VFIO_PCI) += vfio-pci.o | 4 | obj-$(CONFIG_VFIO_PCI) += vfio-pci.o |
diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c index 668d37c730bf..2f865d07df90 100644 --- a/drivers/vfio/pci/vfio_pci.c +++ b/drivers/vfio/pci/vfio_pci.c | |||
@@ -1030,7 +1030,6 @@ put_devs: | |||
1030 | static void __exit vfio_pci_cleanup(void) | 1030 | static void __exit vfio_pci_cleanup(void) |
1031 | { | 1031 | { |
1032 | pci_unregister_driver(&vfio_pci_driver); | 1032 | pci_unregister_driver(&vfio_pci_driver); |
1033 | vfio_virqfd_exit(); | ||
1034 | vfio_pci_uninit_perm_bits(); | 1033 | vfio_pci_uninit_perm_bits(); |
1035 | } | 1034 | } |
1036 | 1035 | ||
@@ -1043,11 +1042,6 @@ static int __init vfio_pci_init(void) | |||
1043 | if (ret) | 1042 | if (ret) |
1044 | return ret; | 1043 | return ret; |
1045 | 1044 | ||
1046 | /* Start the virqfd cleanup handler */ | ||
1047 | ret = vfio_virqfd_init(); | ||
1048 | if (ret) | ||
1049 | goto out_virqfd; | ||
1050 | |||
1051 | /* Register and scan for devices */ | 1045 | /* Register and scan for devices */ |
1052 | ret = pci_register_driver(&vfio_pci_driver); | 1046 | ret = pci_register_driver(&vfio_pci_driver); |
1053 | if (ret) | 1047 | if (ret) |
@@ -1056,8 +1050,6 @@ static int __init vfio_pci_init(void) | |||
1056 | return 0; | 1050 | return 0; |
1057 | 1051 | ||
1058 | out_driver: | 1052 | out_driver: |
1059 | vfio_virqfd_exit(); | ||
1060 | out_virqfd: | ||
1061 | vfio_pci_uninit_perm_bits(); | 1053 | vfio_pci_uninit_perm_bits(); |
1062 | return ret; | 1054 | return ret; |
1063 | } | 1055 | } |
diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c index 4cde85501444..23ba12afe01f 100644 --- a/drivers/vfio/vfio.c +++ b/drivers/vfio/vfio.c | |||
@@ -1553,6 +1553,11 @@ static int __init vfio_init(void) | |||
1553 | if (ret) | 1553 | if (ret) |
1554 | goto err_cdev_add; | 1554 | goto err_cdev_add; |
1555 | 1555 | ||
1556 | /* Start the virqfd cleanup handler used by some VFIO bus drivers */ | ||
1557 | ret = vfio_virqfd_init(); | ||
1558 | if (ret) | ||
1559 | goto err_virqfd; | ||
1560 | |||
1556 | pr_info(DRIVER_DESC " version: " DRIVER_VERSION "\n"); | 1561 | pr_info(DRIVER_DESC " version: " DRIVER_VERSION "\n"); |
1557 | 1562 | ||
1558 | /* | 1563 | /* |
@@ -1565,6 +1570,8 @@ static int __init vfio_init(void) | |||
1565 | 1570 | ||
1566 | return 0; | 1571 | return 0; |
1567 | 1572 | ||
1573 | err_virqfd: | ||
1574 | cdev_del(&vfio.group_cdev); | ||
1568 | err_cdev_add: | 1575 | err_cdev_add: |
1569 | unregister_chrdev_region(vfio.group_devt, MINORMASK); | 1576 | unregister_chrdev_region(vfio.group_devt, MINORMASK); |
1570 | err_alloc_chrdev: | 1577 | err_alloc_chrdev: |
@@ -1579,6 +1586,7 @@ static void __exit vfio_cleanup(void) | |||
1579 | { | 1586 | { |
1580 | WARN_ON(!list_empty(&vfio.group_list)); | 1587 | WARN_ON(!list_empty(&vfio.group_list)); |
1581 | 1588 | ||
1589 | vfio_virqfd_exit(); | ||
1582 | idr_destroy(&vfio.group_idr); | 1590 | idr_destroy(&vfio.group_idr); |
1583 | cdev_del(&vfio.group_cdev); | 1591 | cdev_del(&vfio.group_cdev); |
1584 | unregister_chrdev_region(vfio.group_devt, MINORMASK); | 1592 | unregister_chrdev_region(vfio.group_devt, MINORMASK); |