Skip to content

Commit

Permalink
intel-iommu: Fix kernel hang if interrupt remapping disabled in BIOS
Browse files Browse the repository at this point in the history
BIOS clear DMAR table INTR_REMAP flag to disable interrupt remapping. Current
kernel only check interrupt remapping(IR) flag in DRHD's extended capability
register to decide interrupt remapping support or not. But IR flag will not
change when BIOS disable/enable interrupt remapping.

When user disable interrupt remapping in BIOS or BIOS often defaultly disable
interrupt remapping feature when BIOS is not mature.Though BIOS disable
interrupt remapping but intr_remapping_supported function will always report
to OS support interrupt remapping if VT-d2 chipset populated. On this
cases, kernel will continue enable interrupt remapping and result kernel panic.
This bug exist on almost all platforms with interrupt remapping support.

This patch add DMAR table INTR_REMAP flag check before enable interrupt
remapping.

Signed-off-by: Youquan Song <youquan.song@intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
Youquan Song authored and David Woodhouse committed Sep 11, 2009
1 parent e936d07 commit 074835f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/pci/dmar.c
Original file line number Diff line number Diff line change
Expand Up @@ -1316,3 +1316,13 @@ int dmar_reenable_qi(struct intel_iommu *iommu)

return 0;
}

/*
* Check interrupt remapping support in DMAR table description.
*/
int dmar_ir_support(void)
{
struct acpi_table_dmar *dmar;
dmar = (struct acpi_table_dmar *)dmar_tbl;
return dmar->flags & 0x1;
}
3 changes: 3 additions & 0 deletions drivers/pci/intr_remapping.c
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,9 @@ int __init intr_remapping_supported(void)
if (disable_intremap)
return 0;

if (!dmar_ir_support())
return 0;

for_each_drhd_unit(drhd) {
struct intel_iommu *iommu = drhd->iommu;

Expand Down
2 changes: 2 additions & 0 deletions include/linux/intel-iommu.h
Original file line number Diff line number Diff line change
Expand Up @@ -360,4 +360,6 @@ extern void qi_flush_dev_iotlb(struct intel_iommu *iommu, u16 sid, u16 qdep,

extern int qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu);

extern int dmar_ir_support(void);

#endif

0 comments on commit 074835f

Please sign in to comment.