2009-09-07 06:39:54

by Youquan Song

[permalink] [raw]
Subject: disallow interrupt remapping if not all ioapic under interrupt remapping

Current kernel enable interrupt remapping only when all the vt-d unit support
interrupt remapping. So it is reasonable we should also disallow enabling
intr-remapping if there any io-apics that are not listed under vt-d units.
Otherwise we can run into issues.

Acked-by: Suresh Siddha <[email protected]>
Signed-off-by: Youquan Song <[email protected]>
---

diff --git a/drivers/pci/dmar.c b/drivers/pci/dmar.c
index 7b287cb..a8a4383 100644
--- a/drivers/pci/dmar.c
+++ b/drivers/pci/dmar.c
@@ -570,9 +570,6 @@ int __init dmar_table_init(void)
printk(KERN_INFO PREFIX "No ATSR found\n");
#endif

-#ifdef CONFIG_INTR_REMAP
- parse_ioapics_under_ir();
-#endif
return 0;
}

diff --git a/drivers/pci/intr_remapping.c b/drivers/pci/intr_remapping.c
index 4f5b871..ebfa47b 100644
--- a/drivers/pci/intr_remapping.c
+++ b/drivers/pci/intr_remapping.c
@@ -626,6 +626,11 @@ int __init enable_intr_remapping(int eim)
struct dmar_drhd_unit *drhd;
int setup = 0;

+ if (parse_ioapics_under_ir() != 1) {
+ printk(KERN_INFO "Not enable interrupt remapping\n");
+ return -1;
+ }
+
for_each_drhd_unit(drhd) {
struct intel_iommu *iommu = drhd->iommu;