[PATCH iommufd 3/9] vfio/type1: Convert to msi_device_has_secure_msi()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Use the new API. VFIO can just slot this in the existing iteration over
every device in the group.

Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxx>
---
 drivers/vfio/vfio_iommu_type1.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c
index 3025b4e643c135..a954b58d606766 100644
--- a/drivers/vfio/vfio_iommu_type1.c
+++ b/drivers/vfio/vfio_iommu_type1.c
@@ -37,7 +37,7 @@
 #include <linux/vfio.h>
 #include <linux/workqueue.h>
 #include <linux/notifier.h>
-#include <linux/irqdomain.h>
+#include <linux/msi.h>
 #include "vfio.h"
 
 #define DRIVER_VERSION  "0.2"
@@ -2164,6 +2164,8 @@ static int vfio_iommu_device_secure_msi(struct device *dev, void *data)
 {
 	bool *secure_msi = data;
 
+	if (msi_device_has_secure_msi(dev))
+		return 0;
 	*secure_msi &= device_iommu_capable(dev, IOMMU_CAP_INTR_REMAP);
 	return 0;
 }
@@ -2280,12 +2282,9 @@ static int vfio_iommu_type1_attach_group(void *iommu_data,
 	INIT_LIST_HEAD(&domain->group_list);
 	list_add(&group->next, &domain->group_list);
 
-	msi_remap = irq_domain_check_msi_remap();
-	if (!msi_remap) {
-		msi_remap = true;
-		iommu_group_for_each_dev(iommu_group, &msi_remap,
-					 vfio_iommu_device_secure_msi);
-	}
+	msi_remap = true;
+	iommu_group_for_each_dev(iommu_group, &msi_remap,
+				 vfio_iommu_device_secure_msi);
 
 	if (!allow_unsafe_interrupts && !msi_remap) {
 		pr_warn("%s: No interrupt remapping support.  Use the module param \"allow_unsafe_interrupts\" to enable VFIO IOMMU support on this platform\n",
-- 
2.38.1




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux