Commit d408ea2a authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'iommu-fixes-v3.6-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu

Pull IOMMU fixes from Joerg Roedel:
 "Two fixes are necessary.  One patch fixes a boot crash on MacBook Air
  with interrupt remapping enabled and the other patch fixes a
  regression (which causes a boot crash on AMD IOMMUv2 systems too) in
  the init code of the AMD IOMMU driver."

* tag 'iommu-fixes-v3.6-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
  iommu/amd: Fix wrong check for ARRAY_SIZE()
  irq_remap: disable IRQ remapping if any IOAPIC lacks an IOMMU
parents c71a3552 2bd5ed00
...@@ -1111,7 +1111,7 @@ static void print_iommu_info(void) ...@@ -1111,7 +1111,7 @@ static void print_iommu_info(void)
if (iommu->cap & (1 << IOMMU_CAP_EFR)) { if (iommu->cap & (1 << IOMMU_CAP_EFR)) {
pr_info("AMD-Vi: Extended features: "); pr_info("AMD-Vi: Extended features: ");
for (i = 0; ARRAY_SIZE(feat_str); ++i) { for (i = 0; i < ARRAY_SIZE(feat_str); ++i) {
if (iommu_feature(iommu, (1ULL << i))) if (iommu_feature(iommu, (1ULL << i)))
pr_cont(" %s", feat_str[i]); pr_cont(" %s", feat_str[i]);
} }
......
...@@ -736,6 +736,7 @@ int __init parse_ioapics_under_ir(void) ...@@ -736,6 +736,7 @@ int __init parse_ioapics_under_ir(void)
{ {
struct dmar_drhd_unit *drhd; struct dmar_drhd_unit *drhd;
int ir_supported = 0; int ir_supported = 0;
int ioapic_idx;
for_each_drhd_unit(drhd) { for_each_drhd_unit(drhd) {
struct intel_iommu *iommu = drhd->iommu; struct intel_iommu *iommu = drhd->iommu;
...@@ -748,13 +749,20 @@ int __init parse_ioapics_under_ir(void) ...@@ -748,13 +749,20 @@ int __init parse_ioapics_under_ir(void)
} }
} }
if (ir_supported && ir_ioapic_num != nr_ioapics) { if (!ir_supported)
printk(KERN_WARNING return 0;
"Not all IO-APIC's listed under remapping hardware\n");
for (ioapic_idx = 0; ioapic_idx < nr_ioapics; ioapic_idx++) {
int ioapic_id = mpc_ioapic_id(ioapic_idx);
if (!map_ioapic_to_ir(ioapic_id)) {
pr_err(FW_BUG "ioapic %d has no mapping iommu, "
"interrupt remapping will be disabled\n",
ioapic_id);
return -1; return -1;
} }
}
return ir_supported; return 1;
} }
int __init ir_dev_scope_init(void) int __init ir_dev_scope_init(void)
......
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