看一下intel_irq_remapping_supported
的代码:
static int __init intel_irq_remapping_supported(void)
{
struct dmar_drhd_unit *drhd;
struct intel_iommu *iommu;
if (disable_irq_remap)
return 0;
if (irq_remap_broken) {
printk(KERN_WARNING
"This system BIOS has enabled interrupt remapping\n"
"on a chipset that contains an erratum making that\n"
"feature unstable. To maintain system stability\n"
"interrupt remapping is being disabled. Please\n"
"contact your BIOS vendor for an update\n");
add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_STILL_OK);
disable_irq_remap = 1;
return 0;
}
if (!dmar_ir_support())
return 0;
for_each_iommu(iommu, drhd)
if (!ecap_ir_support(iommu->ecap))
return 0;
return 1;
}
disable_irq_remap
和irq_remap_broken
定义在irq_remapping.c
中,用来判断是否支持IRQ remapping
这个功能。
dmar_ir_support
定义在dmar.c
中:
/*
* Check interrupt remapping support in DMAR table description.
*/
int __init dmar_ir_support(void)
{
struct acpi_table_dmar *dmar;
dmar = (struct acpi_table_dmar *)dmar_tbl;
if (!dmar)
return 0;
return dmar->flags & 0x1;
}
flags
的第0
位标示平台是否支持IRQ remapping
这个功能。
for_each_iommu(iommu, drhd)
if (!ecap_ir_support(iommu->ecap))
return 0;
这段代码检查DMA Remapping Hardware Unit
的所代表的IOMMU
单元是否支持IRQ remapping
这个功能。
如果检查都通过了,返回1
,表示支持IRQ remapping
这个功能。
参考资料:
"BIOS Considerations" in *Intel ® Virtualization Technology for Directed I/O