From: Kunkun Jiang jiangkunkun@huawei.com
virt inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I61SPO CVE: NA
--------------------------------
This reverts commit b6f29e4d0dc417e7eec27d84a7913b80f1b760e1.
Signed-off-by: Kunkun Jiang jiangkunkun@huawei.com Reviewed-by: Keqian Zhu zhukeqian1@huawei.com Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com --- drivers/vfio/pci/vfio_pci.c | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-)
diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c index 352abea42649..514b004c2cc6 100644 --- a/drivers/vfio/pci/vfio_pci.c +++ b/drivers/vfio/pci/vfio_pci.c @@ -451,7 +451,6 @@ vfio_pci_iommu_dev_fault_handler(struct iommu_fault *fault, void *data) (struct vfio_region_dma_fault *)vdev->fault_pages; struct iommu_fault *new; u32 head, tail, size; - int ext_irq_index; int ret = -EINVAL;
if (WARN_ON(!reg)) @@ -476,19 +475,7 @@ vfio_pci_iommu_dev_fault_handler(struct iommu_fault *fault, void *data) ret = 0; unlock: mutex_unlock(&vdev->fault_queue_lock); - if (ret) - return ret; - - ext_irq_index = vfio_pci_get_ext_irq_index(vdev, VFIO_IRQ_TYPE_NESTED, - VFIO_IRQ_SUBTYPE_DMA_FAULT); - if (ext_irq_index < 0) - return -EINVAL; - - mutex_lock(&vdev->igate); - if (vdev->ext_irqs[ext_irq_index].trigger) - eventfd_signal(vdev->ext_irqs[ext_irq_index].trigger, 1); - mutex_unlock(&vdev->igate); - return 0; + return ret; }
#define DMA_FAULT_RING_LENGTH 512 @@ -543,12 +530,6 @@ static int vfio_pci_dma_fault_init(struct vfio_pci_device *vdev) if (ret) /* the dma fault region is freed in vfio_pci_disable() */ goto out;
- ret = vfio_pci_register_irq(vdev, VFIO_IRQ_TYPE_NESTED, - VFIO_IRQ_SUBTYPE_DMA_FAULT, - VFIO_IRQ_INFO_EVENTFD); - if (ret) /* the fault handler is also freed in vfio_pci_disable() */ - goto out; - return 0; out: kfree(vdev->fault_pages);