lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <162164287046.261970.257439178688866229.stgit@djiang5-desk3.ch.intel.com>
Date:   Fri, 21 May 2021 17:21:10 -0700
From:   Dave Jiang <dave.jiang@...el.com>
To:     alex.williamson@...hat.com, kwankhede@...dia.com,
        tglx@...utronix.de, vkoul@...nel.org, jgg@...lanox.com
Cc:     megha.dey@...el.com, jacob.jun.pan@...el.com, ashok.raj@...el.com,
        yi.l.liu@...el.com, baolu.lu@...el.com, kevin.tian@...el.com,
        sanjay.k.kumar@...el.com, tony.luck@...el.com,
        dan.j.williams@...el.com, eric.auger@...hat.com,
        pbonzini@...hat.com, dmaengine@...r.kernel.org,
        linux-kernel@...r.kernel.org, kvm@...r.kernel.org
Subject: [PATCH v6 20/20] vfio: mdev: idxd: setup request interrupt

Add request interrupt support for idxd-mdev driver to support requesting
release of device.

Signed-off-by: Dave Jiang <dave.jiang@...el.com>
---
 drivers/vfio/mdev/idxd/mdev.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/vfio/mdev/idxd/mdev.c b/drivers/vfio/mdev/idxd/mdev.c
index 25d1ac67b0c9..6bf2ec43656c 100644
--- a/drivers/vfio/mdev/idxd/mdev.c
+++ b/drivers/vfio/mdev/idxd/mdev.c
@@ -52,6 +52,8 @@ static int idxd_vdcm_get_irq_count(struct vfio_device *vdev, int type)
 {
 	if (type == VFIO_PCI_MSIX_IRQ_INDEX)
 		return VIDXD_MAX_MSIX_VECS;
+	else if (type == VFIO_PCI_REQ_IRQ_INDEX)
+		return 1;
 
 	return 0;
 }
@@ -486,6 +488,12 @@ static int idxd_vdcm_set_irqs(struct vdcm_idxd *vidxd, uint32_t flags,
 			return mdev_set_msix_trigger(mdev, index, start, count, flags, data);
 		}
 		break;
+	case VFIO_PCI_REQ_IRQ_INDEX:
+		switch (flags & VFIO_IRQ_SET_ACTION_TYPE_MASK) {
+		case VFIO_IRQ_SET_ACTION_TRIGGER:
+			return vfio_mdev_set_req_trigger(mdev, index, start, count, flags, data);
+		}
+		break;
 	}
 
 	return -ENOTTY;
@@ -678,6 +686,7 @@ static long idxd_vdcm_ioctl(struct vfio_device *vdev, unsigned int cmd, unsigned
 
 		switch (info.index) {
 		case VFIO_PCI_MSIX_IRQ_INDEX:
+		case VFIO_PCI_REQ_IRQ_INDEX:
 			info.flags |= VFIO_IRQ_INFO_NORESIZE;
 			break;
 		default:
@@ -750,6 +759,7 @@ static const struct vfio_device_ops idxd_mdev_ops = {
 	.write = idxd_vdcm_write,
 	.mmap = idxd_vdcm_mmap,
 	.ioctl = idxd_vdcm_ioctl,
+	.request = vfio_mdev_request,
 };
 
 static ssize_t name_show(struct mdev_type *mtype, struct mdev_type_attribute *attr, char *buf)


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ