From c3993a22c6acfa0d245259f02aaa4080a8db5903 Mon Sep 17 00:00:00 2001 From: Daniel Krebs Date: Tue, 24 Apr 2018 13:12:02 +0200 Subject: [PATCH] vfio: IOMMU group is always 0 if no IOMMU is present --- fpga/lib/kernel/vfio.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fpga/lib/kernel/vfio.cpp b/fpga/lib/kernel/vfio.cpp index 2bf90b590..4451536ba 100644 --- a/fpga/lib/kernel/vfio.cpp +++ b/fpga/lib/kernel/vfio.cpp @@ -302,7 +302,7 @@ VfioContainer::attachDevice(const pci_device* pdev) } /* Get IOMMU group of device */ - int index = pci_get_iommu_group(pdev); + int index = isIommuEnabled() ? pci_get_iommu_group(pdev) : 0; if (index < 0) { logger->error("Failed to get IOMMU group of device"); throw std::exception();