Warn when kernel booted without IOMMU

parent 1f1f0cd0
......@@ -280,7 +280,7 @@ VfioDevice&
VfioContainer::attachDevice(const pci_device* pdev)
{
int ret;
char name[32];
char name[32], iommu_state[4];
static constexpr const char* kernelDriver = "vfio-pci";
/* Load PCI bus driver for VFIO */
......@@ -303,6 +303,13 @@ VfioContainer::attachDevice(const pci_device* pdev)
/* Get IOMMU group of device */
int index = isIommuEnabled() ? pci_get_iommu_group(pdev) : 0;
if (index < 0) {
ret = kernel_get_cmdline_param("intel_iommu", iommu_state, sizeof(iommu_state));
if(ret != 0 || strcmp("on", iommu_state) != 0)
logger->warn("Kernel booted without command line parameter "
"'intel_iommu' set to 'on'. Please check documentation "
"(https://villas.fein-aachen.org/doc/fpga-setup.html) "
"for help with troubleshooting.");
logger->error("Failed to get IOMMU group of device");
throw std::exception();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment