Skip to content

Fix Intel IRQ remapping initialization order

Joerg Roedel linux-iommu lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5iommu/vt-d: Allocate IRQ remapping data structures only for all IOMMUsdrivers/iommu/intel_irq_remapping.c+6 -40 replies
2/5iommu/vt-d: Don't check for ecap_ir_support in intel_irq_remapping_supporteddrivers/iommu/intel_irq_remapping.c+0 -70 replies
3/5iommu/vt-d: Move supported-checks to intel_prepare_irq_remapping()drivers/iommu/intel_irq_remapping.c+22 -170 replies
4/5iommu/amd: Check for irq-remap support amd_iommu_prepare()drivers/iommu/amd_iommu_init.c+3 -00 replies
5/5iommu, x86, apic: Remove irq_remapping_supported()arch/x86/kernel/apic/apic.c drivers/iommu/amd_iommu.c drivers/iommu/amd_iommu_init.c +4 more+0 -320 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/5] Fix Intel IRQ remapping initialization order

Hi,

here is a patch-set against tip/x86/apic to fix an initialization order problem with the IRQ remapping code. The problem is in the ordering of the irq_remapping_prepare and irq_remapping_supported functions.

Currently the call-order is irq_remapping_prepare -> irq_remapping_supported, so that 'prepare' can succeed but 'supported' fails, so that interrupt remapping gets initialized but not enabled. This causes a broken interrupt setup on affected systems (machines with an Intel IOMMU without, or broken, IRQ remapping support). The result are lost interrupts and a non-bootable system.

Both functions do checks whether IRQ remapping can be enabled on the machine. The reason for this is that some checks rely on dmar_table_init() and thus have to be done in irq_remapping_prepare().

This patch-set moves all these checks into the irq_remapping_prepare() path with the right ordering and removes the irq_remapping_supported() function and its call-backs. This fixes the initializion order problem and simplifies the exported API from the IOMMU code.

Please review.

Thanks,

Joerg

Joerg Roedel (5):
iommu/vt-d: Allocate IRQ remapping data structures only for all IOMMUs iommu/vt-d: Don't check for ecap_ir_support in
intel_irq_remapping_supported
iommu/vt-d: Move supported-checks to intel_prepare_irq_remapping() iommu/amd: Check for irq-remap support amd_iommu_prepare() iommu, x86, apic: Remove irq_remapping_supported()

 arch/x86/kernel/apic/apic.c         |  5 ---
 drivers/iommu/amd_iommu.c           |  1 -
 drivers/iommu/amd_iommu_init.c      |  8 ++---
 drivers/iommu/amd_iommu_proto.h     |  1 -
 drivers/iommu/intel_irq_remapping.c | 62 +++++++++++++++++--------------------
 drivers/iommu/irq_remapping.c       | 11 -------
 drivers/iommu/irq_remapping.h       |  3 --
 7 files changed, 31 insertions(+), 60 deletions(-)
Signature · 1 line
1.9.1